fix type switching over internal pointer union

Fixes #3947
This commit is contained in:
Laytan Laats
2024-08-12 00:02:05 +02:00
parent 26fa3aca44
commit 99aa0d3a35
2 changed files with 25 additions and 1 deletions
+24
View File
@@ -0,0 +1,24 @@
package test_internal
import "core:log"
import "core:testing"
@(test)
test_internal_pointer_union_switch :: proc(t: ^testing.T) {
foo: Maybe(^int)
switch _ in foo {
case ^int:
log.error("incorrect case")
case nil:
}
v := 1
foo = &v
switch _ in foo {
case ^int:
case nil:
log.error("incorrect case")
}
}