Skip to content

Commit 0871eca

Browse files
authored
tests: add test for using reference of map type as struct field (PR #15828) (#15830)
1 parent 201598e commit 0871eca

File tree

4 files changed

+19
-17
lines changed

4 files changed

+19
-17
lines changed

vlib/v/gen/c/testdata/ref_sumtype_as_struct_field.out

Lines changed: 0 additions & 3 deletions
This file was deleted.

vlib/v/gen/c/testdata/ref_sumtype_as_struct_field.vv

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Ptr{
2+
ptr1: &nil
3+
ptr2: &nil
4+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
struct S1 {}
2+
3+
struct S2 {}
4+
5+
type T1 = S1 | S2
6+
7+
struct Ptr {
8+
ptr1 &T1 = unsafe { nil }
9+
ptr2 &map[int]int = unsafe { nil }
10+
}
11+
12+
fn main() {
13+
ptr := Ptr{}
14+
println(ptr)
15+
}

0 commit comments

Comments
 (0)