From cca381f29cc019ee91579006b7bc5681cb204b46 Mon Sep 17 00:00:00 2001 From: "Juan J. Martinez" Date: Sun, 21 Aug 2022 10:16:19 +0100 Subject: Test lambdas can access local variables only --- test/Language.hs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/Language.hs b/test/Language.hs index da5d288..f23fa9a 100644 --- a/test/Language.hs +++ b/test/Language.hs @@ -234,6 +234,16 @@ testCase18 = \def fn(a: u8): u8 { return undef; }\n" E.Undefined +testCase19 = + TestLabel "lambdas can use only local variables" $ + TestCase $ + expectError + "module main\n\ + \def fn(a: u8): () -> u8 {\n\ + \return (): u8 { return a; };\n\ + \}\n" + E.Undefined + language = [ testCase1, testCase2, @@ -252,5 +262,6 @@ language = testCase15, testCase16, testCase17, - testCase18 + testCase18, + testCase19 ] -- cgit v1.2.3