mirror of
https://github.com/vlang/v.git
synced 2025-09-15 15:32:27 +03:00
parser: do not allow "int?", only "?int"
This commit is contained in:
parent
f27f3515ae
commit
d2d75f3824
6 changed files with 10 additions and 17 deletions
|
@ -154,17 +154,13 @@ fn (p mut Parser) get_type2() Type {
|
|||
}
|
||||
else if is_arr {
|
||||
typ = 'array_$typ'
|
||||
// p.log('ARR TYPE="$typ" run=$p.pass')
|
||||
// We come across "[]User" etc ?
|
||||
p.register_array(typ)
|
||||
}
|
||||
p.next()
|
||||
if p.tok == .question || is_question {
|
||||
if is_question {
|
||||
typ = 'Option_$typ'
|
||||
p.table.register_type_with_parent(typ, 'Option')
|
||||
if p.tok == .question {
|
||||
p.next()
|
||||
}
|
||||
}
|
||||
if typ.last_index('__') > typ.index('__') {
|
||||
p.error('2 __ in gettype(): typ="$typ"')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue