diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-04-07 14:23:06 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-04-07 14:23:06 -0700 |
| commit | 3b535d2c3af5259a71916681d87ab0c01f24b58d (patch) | |
| tree | 61816becd81c72f3a8af790798c0f42bf443b5d9 /test/run_tests.cpp | |
| parent | ee22e872967947d2f6e64cba888bf7bf56e4d332 (diff) | |
| download | zig-3b535d2c3af5259a71916681d87ab0c01f24b58d.tar.gz zig-3b535d2c3af5259a71916681d87ab0c01f24b58d.zip | |
fix evaluating generic function instance in wrong context
See #22
Diffstat (limited to 'test/run_tests.cpp')
| -rw-r--r-- | test/run_tests.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index fb232aed70..0ff7385d94 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1781,6 +1781,13 @@ b"; fn foo() {} const invalid = foo > foo; )SOURCE", 1, ".tmp_source.zig:3:21: error: operator not allowed for type 'fn()'"); + + add_compile_fail_case("generic function instance with non-constant expression", R"SOURCE( +fn foo(x: i32)(y: i32) -> i32 { return x + y; } +fn test1(a: i32, b: i32) -> i32 { + return foo(a)(b); +} + )SOURCE", 1, ".tmp_source.zig:4:16: error: unable to resolve constant expression"); } ////////////////////////////////////////////////////////////////////////////// |
