diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2016-09-10 20:53:43 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2016-09-10 20:53:57 -0400 |
| commit | 28811234bb46824a55596a516f763a39bcbd508a (patch) | |
| tree | ee8f7785b14c18fb363f61aebe4414f596edcc17 /test | |
| parent | 1fa4d2a5afd35ebb58c84ea030046fc557ffad01 (diff) | |
| download | zig-28811234bb46824a55596a516f763a39bcbd508a.tar.gz zig-28811234bb46824a55596a516f763a39bcbd508a.zip | |
fix compile error message for wrong arg count on method
Diffstat (limited to 'test')
| -rw-r--r-- | test/run_tests.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp index c2fdb0904a..8fa6f33211 100644 --- a/test/run_tests.cpp +++ b/test/run_tests.cpp @@ -1457,6 +1457,16 @@ fn f(m: []const u8) { m.copy(u8, self.list.items[old_len...], m); } )SOURCE", 1, ".tmp_source.zig:3:6: error: no member named 'copy' in '[]const u8'"); + + add_compile_fail_case("wrong number of arguments for method fn call", R"SOURCE( +struct Foo { + fn method(self: &const Foo, a: i32) {} +} +fn f(foo: &const Foo) { + + foo.method(1, 2); +} + )SOURCE", 1, ".tmp_source.zig:7:15: error: expected 1 arguments, got 2"); } ////////////////////////////////////////////////////////////////////////////// |
