gop icon indicating copy to clipboard operation
gop copied to clipboard

support variable delayed loading

Open visualfc opened this issue 2 years ago • 0 comments

The following program sample.gop triggers an unexpected result

// add a sample
package main

type S string
var a, b, c, d = len(b), S(c), "hello", c + "word"
func main() {
	println(a, b, c, d)
}

Expected result

5 hello hello helloword

Got

prog.go:5:22: undefined: b
prog.go:8:10: undefined: a
===> errors stack:
gop.LoadDir(".", 0xc0000d2750, false)
	/root/goplus/gengo.go:159 LoadDir(dir, conf, genTestPkg)

Gop Version

main version

Additional Notes

No response

visualfc avatar Nov 14 '23 03:11 visualfc