You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A panic occurs when performing a type assertion on an interface{} in Gnolang. The following code works as expected in Go (Golang), but in Gnolang, it results in a runtime panic:
package main
import"fmt"funcmain() {
variinterface{} =1vara, ok=i.(int)
fmt.Println(a, ok)
}
Expected Behavior:
The code should execute without panic, correctly performing the type assertion. The expected output should be:
1 true
Actual Behavior:
In Gnolang, running the above code causes a panic with the message:
panic: interface conversion: gnolang.Expr is *gnolang.TypeAssertExpr, not *gnolang.CallExpr
This suggests an issue with how type assertions are being handled internally, specifically when converting types within the interface.
The text was updated successfully, but these errors were encountered:
yes; we should unify the code for DeclStmt and AssignStmt (ie. := and var x =); as they are supposed to be almost equivalent in the go spec but they do very different things in preprocess
Description:
Issue Summary:
A panic occurs when performing a type assertion on an
interface{}
in Gnolang. The following code works as expected in Go (Golang), but in Gnolang, it results in a runtime panic:Expected Behavior:
The code should execute without panic, correctly performing the type assertion. The expected output should be:
Actual Behavior:
In Gnolang, running the above code causes a panic with the message:
This suggests an issue with how type assertions are being handled internally, specifically when converting types within the interface.
The text was updated successfully, but these errors were encountered: