aboutsummaryrefslogtreecommitdiff
path: root/test/compile_errors.zig
diff options
context:
space:
mode:
Diffstat (limited to 'test/compile_errors.zig')
-rw-r--r--test/compile_errors.zig8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/compile_errors.zig b/test/compile_errors.zig
index 16c36dc294..e2f4489b0f 100644
--- a/test/compile_errors.zig
+++ b/test/compile_errors.zig
@@ -1987,4 +1987,12 @@ pub fn addCases(cases: &tests.CompileErrorContext) {
\\}
,
".tmp_source.zig:2:17: error: expected type 'u3', found 'u8'");
+
+ cases.add("globally shadowing a primitive type",
+ \\const u16 = @intType(false, 8);
+ \\export fn entry() {
+ \\ const a: u16 = 300;
+ \\}
+ ,
+ ".tmp_source.zig:1:1: error: declaration shadows type 'u16'");
}