Skip to content

Commit

Permalink
tests: add test for using reference of map type as struct field (PR #…
Browse files Browse the repository at this point in the history
  • Loading branch information
shove70 committed Sep 21, 2022
1 parent 201598e commit 0871eca
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
3 changes: 0 additions & 3 deletions vlib/v/gen/c/testdata/ref_sumtype_as_struct_field.out

This file was deleted.

14 changes: 0 additions & 14 deletions vlib/v/gen/c/testdata/ref_sumtype_as_struct_field.vv

This file was deleted.

4 changes: 4 additions & 0 deletions vlib/v/gen/c/testdata/ref_sumtype_map_as_struct_field.out
@@ -0,0 +1,4 @@
Ptr{
ptr1: &nil
ptr2: &nil
}
15 changes: 15 additions & 0 deletions vlib/v/gen/c/testdata/ref_sumtype_map_as_struct_field.vv
@@ -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)
}

0 comments on commit 0871eca

Please sign in to comment.