We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sample.go
package main import ( "fmt" ) func SomeFunc(defaultValue interface{}) interface{} { switch v := defaultValue.(type) { case string: return v + " abc" case int: return v - 234 } panic("whoops") } func main() { fmt.Println(SomeFunc("test")) fmt.Println(SomeFunc(1234)) }
go run main.go test abc 1000
yaegi main.go main.go:8:2: panic main.go:18:2: panic run: runtime error: invalid memory address or nil pointer dereference
0.14.2
panics when appending the string
return v + " abc"
The text was updated successfully, but these errors were encountered:
interp: fix handling interface in operators
6036a52
In case of interface values, make sure that the concrete type is preserved during type inference. Fixes traefik#1466.
fd839aa
4a80936
In case of interface values, make sure that the concrete type is preserved during type inference. Fixes #1466.
Successfully merging a pull request may close this issue.
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
0.14.2
Additional Notes
panics when appending the string
The text was updated successfully, but these errors were encountered: