compiler: fix import alias handling

This commit is contained in:
Evgeniy Stratonikov 2021-03-04 14:36:15 +03:00
parent f454112845
commit 8f8c7d2839
3 changed files with 24 additions and 3 deletions

View file

@ -48,3 +48,16 @@ func TestMultipleDirFileImport(t *testing.T) {
`
eval(t, src, big.NewInt(1))
}
func TestImportNameSameAsOwn(t *testing.T) {
src := `package foo
import "github.com/nspcc-dev/neo-go/pkg/compiler/testdata/foo"
func get3() int { return 3 }
func Main() int {
return get3()
}
func unused() int {
return foo.Bar()
}`
eval(t, src, big.NewInt(3))
}