Call for bikeshed -- break replacement in expression switch
maurizio.cimadamore at oracle.com
Thu May 16 20:34:03 UTC 2019
On 16/05/2019 21:04, Brian Goetz wrote:
> The notion of “reserved word” is insufficiently precise. More
> precisely, yield is a _reserved type identifier_, like `var`. That
> means that you cannot have a class called `yield`, but you can have
> local variables, or methods, or fields, or type variables, with that
Yep - but it's also different from 'var' in the sense that 'var' never
had to fight with ambiguities with method names because it only applied
to the 'type' part of a variable declaration, which is either a
(possibly qualified) identifier (possibly followed by '<'). Parenthesis
were never allowed where 'var' as a type was expected.
For yield Eamon is right - there's a new kind of ambiguity.
On the other hand is a trivial one to resolve, given what we're
discussing now is something like
so, as soon as the compiler sees a "(" it will say: "ok, that's not a
new yield statement".
> for further guidance on the fine degrees of shading between keywords,
> context-sensitive keywords, reserved identifiers, and reserved type
>> On May 16, 2019, at 3:56 PM, Éamonn McManus <emcmanus at google.com
>> <mailto:emcmanus at google.com>> wrote:
>> "yield" isn't a reserved word, is it? Doesn't that mean that
>> `yield(5);` is ambiguous?
More information about the amber-spec-observers