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
The following program sample.go triggers an unexpected result
package main
import"fmt"typebasicstruct{}
func (b*basic) Run() {
test:= []any{b} // Placing the reference to the struct in a slice "changes" it somehowfmt.Println(test[0] ==b) // Should be true, is false insteadfmt.Println(b, test[0]) // Both objects printed should be identical; they are on Go, and aren't on Yaegi
}
funcmain() {
b:=&basic{}
b.Run()
}
Hello, I stumbled on this when checking equality to a struct pointer I placed in a slice; for whatever reason, the pointer is modified when placed into the slice, such that its reference no longer equates to itself.
The text was updated successfully, but these errors were encountered:
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
devel
Additional Notes
Hello, I stumbled on this when checking equality to a struct pointer I placed in a slice; for whatever reason, the pointer is modified when placed into the slice, such that its reference no longer equates to itself.
The text was updated successfully, but these errors were encountered: