mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: emit Option_ typedef for fn args and struct fields
This commit is contained in:

committed by
Alexander Medvednikov

parent
5536eb581c
commit
26fb7e0821
@ -196,6 +196,10 @@ fn (p mut Parser) struct_decl() {
|
||||
if field_type == name {
|
||||
p.error_with_token_index( 'cannot embed struct `$name` in itself (field `$field_name`)', field_name_token_idx)
|
||||
}
|
||||
// Register ?option type
|
||||
if field_type.starts_with('Option_') {
|
||||
p.gen_typedef('typedef Option $field_type;')
|
||||
}
|
||||
p.check_and_register_used_imported_type(field_type)
|
||||
is_atomic := p.tok == .key_atomic
|
||||
if is_atomic {
|
||||
|
Reference in New Issue
Block a user