diff options
author | Juan J. Martinez <jjm@usebox.net> | 2022-08-21 10:16:19 +0100 |
---|---|---|
committer | Juan J. Martinez <jjm@usebox.net> | 2022-08-21 10:16:19 +0100 |
commit | cca381f29cc019ee91579006b7bc5681cb204b46 (patch) | |
tree | 37aaccfc56a0ef184d105e257b02e5bf9aa1bde9 /test/Language.hs | |
parent | 6660222a799c57b71eb0272dbe53d76f36c0e4be (diff) | |
download | micro-lang-hs-cca381f29cc019ee91579006b7bc5681cb204b46.tar.gz micro-lang-hs-cca381f29cc019ee91579006b7bc5681cb204b46.zip |
Test lambdas can access local variables only
Diffstat (limited to 'test/Language.hs')
-rw-r--r-- | test/Language.hs | 13 |
1 files changed, 12 insertions, 1 deletions
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 ] |