mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
This commit is contained in:
@ -1,3 +0,0 @@
|
|||||||
SumTypePtr{
|
|
||||||
ptr: &nil
|
|
||||||
}
|
|
@ -1,14 +0,0 @@
|
|||||||
struct S1 {}
|
|
||||||
|
|
||||||
struct S2 {}
|
|
||||||
|
|
||||||
type T1 = S1 | S2
|
|
||||||
|
|
||||||
struct SumTypePtr {
|
|
||||||
ptr &T1 = unsafe { nil }
|
|
||||||
}
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
ptr := SumTypePtr{}
|
|
||||||
println(ptr)
|
|
||||||
}
|
|
4
vlib/v/gen/c/testdata/ref_sumtype_map_as_struct_field.out
vendored
Normal file
4
vlib/v/gen/c/testdata/ref_sumtype_map_as_struct_field.out
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Ptr{
|
||||||
|
ptr1: &nil
|
||||||
|
ptr2: &nil
|
||||||
|
}
|
15
vlib/v/gen/c/testdata/ref_sumtype_map_as_struct_field.vv
vendored
Normal file
15
vlib/v/gen/c/testdata/ref_sumtype_map_as_struct_field.vv
vendored
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
struct S1 {}
|
||||||
|
|
||||||
|
struct S2 {}
|
||||||
|
|
||||||
|
type T1 = S1 | S2
|
||||||
|
|
||||||
|
struct Ptr {
|
||||||
|
ptr1 &T1 = unsafe { nil }
|
||||||
|
ptr2 &map[int]int = unsafe { nil }
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
ptr := Ptr{}
|
||||||
|
println(ptr)
|
||||||
|
}
|
Reference in New Issue
Block a user