Daniel,

just for the record, the problem occurs with “1>2?[3] as Set:null” and similar 
expressions. It is not caused, far as I understand, solely by “as”, but rather 
by a combination with the “safe” (non-NPE) indexing syntax, as Paul mentioned 
before.

> On 16 May 2020, at 2:51, Daniel.Sun <sun...@apache.org> wrote:
> `as` can be used as identifier... but it is a keyword in the meantime...
> We can eliminate the ambiguities by stopping supporting `as` used as
> identifier.

Myself, I'd vote against: it would bring another breaking change for legacy 
sources which happen to use “as” for an identifier. Perhaps I do that myself, 
too; difficult to say, the codebase's big and offhand I can't see a reasonable 
regexp to check :)

If the aforementioned problem with “1>2?[3] as Set:null” is difficult to solve, 
I'd recommend to let it lay as a known bug with an extremely low priority to 
fix: it is a very rare case and very easily solved (adding a pair of 
parentheses is considerably easier and less error-prone than renaming 
variables, which might be needed in case of “as” not useable anymore).

(I'll try to get to adding a ticket for that ASAP, but I've got this week-end 
pretty busy, and first thing I need to do is test the snapshot with the 
joint-compilation fix — for which I'm very grateful, thanks!)

Thanks and all the best,
OC

Reply via email to