Sema: fix comparison with undefined

This commit is contained in:
Bogdan Romanyuk
2023-11-12 12:03:23 +03:00
committed by GitHub
parent 2eeb735822
commit 547481c31c
2 changed files with 34 additions and 10 deletions

View File

@@ -0,0 +1,10 @@
pub fn entry() void {
var foo: ?*i32 = undefined;
if (foo == undefined) {}
}
// error
// backend=stage2
// target=native
//
// :3:13: error: use of undefined value here causes undefined behavior