diff options
| author | Veikka Tuominen <git@vexu.eu> | 2023-01-05 13:43:06 +0200 |
|---|---|---|
| committer | Veikka Tuominen <git@vexu.eu> | 2023-01-05 14:26:53 +0200 |
| commit | 3e084d8de352927dad182f99aeb3f166b348c192 (patch) | |
| tree | 1476e9edc967d1475bd6f91d984cf6178c5b46ea /test/cases/compile_errors | |
| parent | 01dba1c054724b4957778932fb5cd0df14d214b3 (diff) | |
| download | zig-3e084d8de352927dad182f99aeb3f166b348c192.tar.gz zig-3e084d8de352927dad182f99aeb3f166b348c192.zip | |
Sema: only untyped undefined should coerce to all types
Closes #13958
Diffstat (limited to 'test/cases/compile_errors')
| -rw-r--r-- | test/cases/compile_errors/only_untyped_undef_coerces_to_all_types.zig | 11 |
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' |
