fix compiler assertion failure when returning value from test

closes #1935
This commit is contained in:
Andrew Kelley
2019-02-08 19:23:46 -05:00
parent c2db077574
commit 46ddd5f5f4
3 changed files with 29 additions and 5 deletions

View File

@@ -1,6 +1,13 @@
const tests = @import("tests.zig");
pub fn addCases(cases: *tests.CompileErrorContext) void {
cases.addTest(
"return invalid type from test",
\\test "example" { return 1; }
,
".tmp_source.zig:1:25: error: integer value 1 cannot be implicitly casted to type 'void'",
);
cases.add(
"threadlocal qualifier on const",
\\threadlocal const x: i32 = 1234;