/Users/vkuzkokov/tmp/test.fan(3,24): Expected '|', not ')'
Changing signature to |Str? ->| helps. Seems like ?-> is parsed as one token. Though we can enforce using ? -> in type signatures, it would help to see something like
/Users/vkuzkokov/tmp/test.fan(3,18): Expected '|', not '?->'
brianFri 10 Sep 2010
The signature |Str?->| isn't a legal function type. It needs to be either |Str?| or |Str?->ReturnType|. The ?-> token is handled though (Parser.fan line 2204).
vkuzkokovFri 10 Sep 2010
So far |A->| worked exactly as |A->Void| in every context possible.
brianFri 10 Sep 2010
Renamed from ?-> in closure signatures to Don't allow |A->| function signatures
brianFri 10 Sep 2010
Promoted to ticket #1204 and assigned to brian
So far |A->| worked exactly as |A->Void| in every context possible.
Ok, that is a bug. The grammar is defined as:
<funcType> := "|" [formals] ["->" <type>] "|"
I will take a look.
brianSun 12 Sep 2010
Ticket resolved in 1.0.55
Tightened up the parser so that function type signatures with parameters must either omit the arrow or include an explicit return type.
vkuzkokov Fri 10 Sep 2010
On compiling this:
I get:
Changing signature to
|Str? ->|
helps. Seems like?->
is parsed as one token. Though we can enforce using? ->
in type signatures, it would help to see something likebrian Fri 10 Sep 2010
The signature
|Str?->|
isn't a legal function type. It needs to be either|Str?|
or|Str?->ReturnType|
. The?->
token is handled though (Parser.fan line 2204).vkuzkokov Fri 10 Sep 2010
So far
|A->|
worked exactly as|A->Void|
in every context possible.brian Fri 10 Sep 2010
Renamed from ?-> in closure signatures to Don't allow |A->| function signatures
brian Fri 10 Sep 2010
Promoted to ticket #1204 and assigned to brian
Ok, that is a bug. The grammar is defined as:
I will take a look.
brian Sun 12 Sep 2010
Ticket resolved in 1.0.55
Tightened up the parser so that function type signatures with parameters must either omit the arrow or include an explicit return type.