From c51c1a9a7b424cba230991604eab639d61dc3e09 Mon Sep 17 00:00:00 2001 From: deelawn Date: Tue, 2 Jul 2024 12:30:02 -0700 Subject: [PATCH] fixed selector type aliasing --- gnovm/pkg/gnolang/preprocess.go | 2 +- gnovm/tests/files/type_alias.gno | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 gnovm/tests/files/type_alias.gno diff --git a/gnovm/pkg/gnolang/preprocess.go b/gnovm/pkg/gnolang/preprocess.go index c830d1a18f0..9ad7e247457 100644 --- a/gnovm/pkg/gnolang/preprocess.go +++ b/gnovm/pkg/gnolang/preprocess.go @@ -3125,7 +3125,7 @@ func tryPredefine(store Store, last BlockNode, d Decl) (un Name) { pn := pv.GetPackageNode(store) tx.Path = pn.GetPathForName(store, tx.Sel) ptr := pv.GetBlock(store).GetPointerTo(store, tx.Path) - t = ptr.TV.T + t = ptr.TV.GetType() default: panic(fmt.Sprintf( "unexpected type declaration type %v", diff --git a/gnovm/tests/files/type_alias.gno b/gnovm/tests/files/type_alias.gno new file mode 100644 index 00000000000..e95c54126ec --- /dev/null +++ b/gnovm/tests/files/type_alias.gno @@ -0,0 +1,12 @@ +// PKGPATH: gno.land/r/type_alias_test +package type_alias_test + +import "gno.land/p/demo/uassert" + +type TestingT = uassert.TestingT + +func main() { + println(TestingT) +} + +// No need for output; not panicking is passing.