From af12ca140043803d2c4f028d31968cabf67814d2 Mon Sep 17 00:00:00 2001 From: deelawn Date: Thu, 29 Aug 2024 18:31:57 -0700 Subject: [PATCH] func lit tests --- gnovm/tests/files/addressable_8.gno | 9 +++++++++ gnovm/tests/files/addressable_8a_err.gno | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 gnovm/tests/files/addressable_8.gno create mode 100644 gnovm/tests/files/addressable_8a_err.gno diff --git a/gnovm/tests/files/addressable_8.gno b/gnovm/tests/files/addressable_8.gno new file mode 100644 index 00000000000..b28c4292661 --- /dev/null +++ b/gnovm/tests/files/addressable_8.gno @@ -0,0 +1,9 @@ +package main + +func main() { + f := func() { println("Hello, World!") } + println(&f) +} + +// Output: +// &( func()()) diff --git a/gnovm/tests/files/addressable_8a_err.gno b/gnovm/tests/files/addressable_8a_err.gno new file mode 100644 index 00000000000..6e3395da773 --- /dev/null +++ b/gnovm/tests/files/addressable_8a_err.gno @@ -0,0 +1,8 @@ +package main + +func main() { + _ = &func() { println("Hello, World!") } +} + +// Error: +// main/files/addressable_8a_err.gno:4:6: cannot take address of func func(){ (const (println func(xs ...interface{})()))((const ("Hello, World!" string))) }