From 44f38b04b0cc374fcd377df0fe68f29c824185ff Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Wed, 31 Jan 2018 11:13:39 -0500 Subject: fix assertion fail when using global var number literal closes #697 --- test/compile_errors.zig | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'test/compile_errors.zig') diff --git a/test/compile_errors.zig b/test/compile_errors.zig index 223646e767..3267ea7435 100644 --- a/test/compile_errors.zig +++ b/test/compile_errors.zig @@ -1,6 +1,13 @@ const tests = @import("tests.zig"); pub fn addCases(cases: &tests.CompileErrorContext) void { + cases.add("use invalid number literal as array index", + \\var v = 25; + \\export fn entry() void { + \\ var arr: [v]u8 = undefined; + \\} + , ".tmp_source.zig:1:1: error: unable to infer variable type"); + cases.add("duplicate struct field", \\const Foo = struct { \\ Bar: i32, -- cgit v1.2.3