diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-05-06 19:49:28 -0700 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-05-06 19:49:28 -0700 |
| commit | 271a37b418828c8ee79402f97016be42c5fa2884 (patch) | |
| tree | 4834923022eddbc1e314a0d4d2844d15c0829574 /test/run_tests.cpp | |
| parent | 6131b3716322d60cf26f7aad1a654dc6c4414051 (diff) | |
| download | zig-271a37b418828c8ee79402f97016be42c5fa2884.tar.gz zig-271a37b418828c8ee79402f97016be42c5fa2884.zip | |
implicit wrap widening cast on integer peer types
closes #46
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 f183b648e2..130b99fd65 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1354,6 +1354,13 @@ fn mul(a: u16, b: u16) -> u16 { ".tmp_source.zig:5:1: error: function evaluation caused overflow", ".tmp_source.zig:3:18: note: called from here", ".tmp_source.zig:6:7: note: overflow occurred here"); + + add_compile_fail_case("add incompatible int types", R"SOURCE( +fn add(x: i8w, y: i32) { + const z = x + y; +} + )SOURCE", 1, ".tmp_source.zig:3:17: error: incompatible types: 'i8w' and 'i32'"); + } ////////////////////////////////////////////////////////////////////////////// |
