parent
dd06698ee3
commit
3f351036a2
|
@ -736,7 +736,8 @@ fn (mut p Parser) fn_args() ([]ast.Param, bool, bool) {
|
||||||
|| (p.peek_tok.kind == .comma && p.table.known_type(argname))
|
|| (p.peek_tok.kind == .comma && p.table.known_type(argname))
|
||||||
|| p.peek_tok.kind == .dot || p.peek_tok.kind == .rpar
|
|| p.peek_tok.kind == .dot || p.peek_tok.kind == .rpar
|
||||||
|| (p.tok.kind == .key_mut && (p.peek_token(2).kind == .comma
|
|| (p.tok.kind == .key_mut && (p.peek_token(2).kind == .comma
|
||||||
|| p.peek_token(2).kind == .rpar))
|
|| p.peek_token(2).kind == .rpar || (p.peek_token(1).kind == .name
|
||||||
|
&& p.peek_token(2).kind == .dot)))
|
||||||
// TODO copy pasta, merge 2 branches
|
// TODO copy pasta, merge 2 branches
|
||||||
if types_only {
|
if types_only {
|
||||||
mut arg_no := 1
|
mut arg_no := 1
|
||||||
|
|
|
@ -0,0 +1,16 @@
|
||||||
|
module main
|
||||||
|
|
||||||
|
import time
|
||||||
|
|
||||||
|
struct Game {
|
||||||
|
update fn (mut time.Time) = fn (mut time time.Time) {}
|
||||||
|
draw fn (mut time.Time) = fn (mut time time.Time) {}
|
||||||
|
mut:
|
||||||
|
time time.Time
|
||||||
|
}
|
||||||
|
|
||||||
|
fn test_fn_type_only_argument() {
|
||||||
|
mut game := Game{}
|
||||||
|
game.time = time.Time{}
|
||||||
|
assert true
|
||||||
|
}
|
Loading…
Reference in New Issue