mirror of
https://github.com/traefik/yaegi.git
synced 2026-06-01 18:37:56 +00:00
This adds type checking to TypeAssertExpr. In order to allow for this, method types now have a receiver type in both reflect and native cases.
15 lines
179 B
Go
15 lines
179 B
Go
package main
|
|
|
|
import "strconv"
|
|
|
|
func main() {
|
|
var err error
|
|
_, err = strconv.Atoi("erwer")
|
|
if _, ok := err.(*strconv.NumError); ok {
|
|
println("here")
|
|
}
|
|
}
|
|
|
|
// Output:
|
|
// here
|