Open mbrandonw opened 1 year ago
I'm definitely interested in knowing if this is intended behavior or not for the parser in general; thanks for filing the apple/swift issue.
But if the Swift compiler today requires the semicolon, then we'll have to make an exception to not remove it in that case.
Does this only happen for local variables with a property wrapper and without an explicit type annotation or initializer? Are there other cases that break in the same way?
Does this only happen for local variables with a property wrapper and without an explicit type annotation or initializer? Are there other cases that break in the same way?
Local variables with an inferred type is the only way we've come across it so far. Supplying an explicit type is the workaround we use when we come across this bug on CI.
@allevato This may have been fixed a little over a month ago (https://github.com/apple/swift/pull/61036), so maybe this won't be an issue in the next Swift release.
Tracked in Apple’s issue tracker as rdar://126948232
The following valid Swift code:
…gets formatted like this (notice the semi-colon is removed):
This code is not valid Swift code. I'm not sure if this is a bug in the Swift parser, or perhaps this code cannot be unambiguously parsed (I filed a bug).
Should semi-colons be left in in order to work around this issue?