mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser: fix error when using imported types in short fn signature (#7795)
This commit is contained in:
parent
e943d03298
commit
6bd35505a2
@ -493,7 +493,8 @@ fn (mut p Parser) fn_args() ([]table.Param, bool, bool) {
|
||||
p.tok.lit
|
||||
}
|
||||
types_only := p.tok.kind in [.amp, .ellipsis, .key_fn] ||
|
||||
(p.peek_tok.kind == .comma && p.table.known_type(argname)) || p.peek_tok.kind == .rpar
|
||||
(p.peek_tok.kind == .comma && p.table.known_type(argname)) || p.peek_tok.kind == .dot ||
|
||||
p.peek_tok.kind == .rpar
|
||||
// TODO copy pasta, merge 2 branches
|
||||
if types_only {
|
||||
// p.warn('types only')
|
||||
|
@ -1,3 +1,4 @@
|
||||
import time
|
||||
// 1 line comment // 1 line comment
|
||||
/*
|
||||
multi line comment (1)
|
||||
@ -40,6 +41,8 @@ type F5 = fn (int, int) int
|
||||
|
||||
type F6 = fn (int, int)
|
||||
|
||||
type F7 = fn (time.Time, int)
|
||||
|
||||
fn C.atoi(byteptr) int
|
||||
|
||||
fn foo() {
|
||||
|
Loading…
Reference in New Issue
Block a user