test extractVal

This commit is contained in:
xushiwei
2024-05-24 23:06:11 +08:00
parent d1a6d29fdd
commit e6f8cfb16c
2 changed files with 156 additions and 79 deletions

View File

@@ -1,10 +1,18 @@
package main
import (
"github.com/goplus/llgo/cl/internal/foo"
)
import "github.com/goplus/llgo/cl/internal/foo"
func Foo() any {
return struct{ v int }{1}
}
func main() {
v := Foo()
if x, ok := v.(struct{ v int }); ok {
println(x.v)
} else {
println("Foo: not ok")
}
bar := foo.Bar()
if x, ok := bar.(struct{ V int }); ok {
println(x.V)