Commit 76c8efd56c

Andrew Kelley <superjoe30@gmail.com>
2018-06-06 05:54:14
add test for not allowing implicit cast from T to [*]const T
See #770
1 parent bd13e75
Changed files (1)
test/compile_errors.zig
@@ -1,6 +1,15 @@
 const tests = @import("tests.zig");
 
 pub fn addCases(cases: *tests.CompileErrorContext) void {
+    cases.add(
+        "attempted implicit cast from T to [*]const T",
+        \\export fn entry() void {
+        \\    const x: [*]const bool = true;
+        \\}
+    ,
+        ".tmp_source.zig:2:30: error: expected type '[*]const bool', found 'bool'",
+    );
+
     cases.add(
         "dereference unknown length pointer",
         \\export fn entry(x: [*]i32) i32 {