mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parent
43931be451
commit
3c7c11e55b
@ -6038,6 +6038,12 @@ fn (mut g Gen) write_types(types []ast.TypeSymbol) {
|
||||
if typ.name.starts_with('C.') {
|
||||
continue
|
||||
}
|
||||
if typ.kind == .none_ {
|
||||
g.type_definitions.writeln('struct none {')
|
||||
g.type_definitions.writeln('\tEMPTY_STRUCT_DECLARATION;')
|
||||
g.type_definitions.writeln('};')
|
||||
g.typedefs2.writeln('typedef struct none none;')
|
||||
}
|
||||
// sym := g.table.get_type_symbol(typ)
|
||||
mut name := typ.cname
|
||||
match mut typ.info {
|
||||
|
5
vlib/v/tests/sum_type_with_none_type_test.v
Normal file
5
vlib/v/tests/sum_type_with_none_type_test.v
Normal file
@ -0,0 +1,5 @@
|
||||
type MapValue = int | none
|
||||
|
||||
fn test_sum_type_with_none_type() {
|
||||
assert true
|
||||
}
|
Loading…
Reference in New Issue
Block a user