Hi all,

I’m investigating this bug: https://bugs.swift.org/browse/SR-186

Which appears to be a result of the fact that the logic that determines if an 
operator is prefix/postfix/binary does not treat comments as whitespace. So, 
for example:

/* comment */!foo

does not lex as expected because the ā€œ!" thinks it has an something on both 
sides and so is treated as a binary operator. 

Fixing this (by treating comments as whitespace here) will break existing code 
which relies on the current behavior, such as:

foo/* comment */!

which currently treats the ā€œ!ā€ as a postfix operator but will change to binary. 
I expect these cases would be rare (maybe in some generated code?), but the 
results might be pretty confusing. 

Any objections to fixing this or other thoughts? 

Thanks,
Jesse
_______________________________________________
swift-dev mailing list
swift-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-dev

Reply via email to