aboutsummaryrefslogtreecommitdiff
path: root/test/run_tests.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-08-16 23:24:33 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-08-16 23:24:33 -0700
commit0fbb9e09ea89ea24ec214b244e1de9574516c74c (patch)
tree49f3de24d33fe361500e0400215aea73326d7700 /test/run_tests.cpp
parenta2ac06dcd506fd5e119e4eb8e1de201fefa05bbc (diff)
downloadzig-0fbb9e09ea89ea24ec214b244e1de9574516c74c.tar.gz
zig-0fbb9e09ea89ea24ec214b244e1de9574516c74c.zip
fix crash when calling method on slice
Diffstat (limited to 'test/run_tests.cpp')
-rw-r--r--test/run_tests.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/run_tests.cpp b/test/run_tests.cpp
index f777551151..e95c0aa731 100644
--- a/test/run_tests.cpp
+++ b/test/run_tests.cpp
@@ -1451,6 +1451,12 @@ fn function_with_return_type_type() {
".tmp_source.zig:3:5: error: failed to evaluate function at compile time",
".tmp_source.zig:4:5: note: unable to evaluate this expression at compile time",
".tmp_source.zig:3:32: note: required to be compile-time function because of return type 'type'");
+
+ add_compile_fail_case("bogus method call on slice", R"SOURCE(
+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'");
}
//////////////////////////////////////////////////////////////////////////////