mirror of
https://github.com/vlang/v.git
synced 2025-09-14 23:12:33 +03:00
use get_type2 in struct.v
This commit is contained in:
parent
cca650c655
commit
79b26b1654
3 changed files with 16 additions and 4 deletions
|
@ -194,9 +194,10 @@ fn (p mut Parser) struct_decl() {
|
|||
// `pub` access mod
|
||||
access_mod := if is_pub_field { AccessMod.public } else { AccessMod.private}
|
||||
p.fspace()
|
||||
field_type := p.get_type()
|
||||
tt := p.get_type2()
|
||||
field_type := tt.name
|
||||
if field_type == name {
|
||||
p.error_with_token_index( 'cannot embed struct `$name` in itself (field `$field_name`)', field_name_token_idx)
|
||||
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_') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue