aboutsummaryrefslogtreecommitdiff
path: root/test/cases/compile_errors
diff options
context:
space:
mode:
Diffstat (limited to 'test/cases/compile_errors')
-rw-r--r--test/cases/compile_errors/only_untyped_undef_coerces_to_all_types.zig11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/cases/compile_errors/only_untyped_undef_coerces_to_all_types.zig b/test/cases/compile_errors/only_untyped_undef_coerces_to_all_types.zig
new file mode 100644
index 0000000000..091c51ff3b
--- /dev/null
+++ b/test/cases/compile_errors/only_untyped_undef_coerces_to_all_types.zig
@@ -0,0 +1,11 @@
+pub export fn entry() void {
+ const x: []u8 = undefined;
+ const y: f32 = x;
+ _ = y;
+}
+
+// error
+// backend=stage2
+// target=native
+//
+// :3:20: error: expected type 'f32', found '[]u8'