Commit Graph

1 Commits

Author SHA1 Message Date
Rintaro Ishizaki
6a1604ba09 [ASTPrinter/Parse] Disambiguate accessor block in .swiftinterface
.swiftinterface sometimes prints a pattern binding initializer and the
accessor block. However the parser doesn't expect such constructs and
the disambiguation from trailing closures would be fragile. To make it
reliable, introduce a disambiguation marker `@_accessorBlock` .
`ASTPrinter` prints it right after `{` only if 1) The accessor block is
for a pattern binding declaration, 2) the decl has an initializer
printed, and 3) the non-observer accessor block is being printed. In the
parser, if the block after an initializer starts with
`{ @_accessorBlock`, it's always parsed as an accessor block instead of
a trailing closure.

rdar://140943107
2025-10-16 22:16:29 -07:00