Files
swift-mirror/validation-test/IDE
Rintaro Ishizaki d78bf22413 [CodeCompletion] Fix crashes in TypeCheckASTNodeAtLocRequest
receive {
    switch <HERE>
  }

In the current Parser implementation, if there's a error in 'switch'
subject, the 'SwitchStmt' is not placed in the parsed AST.

When the type checker searches AST node at the location, it used to find
'receive { ... }' because that is the *innermost* node in the AST that
contains the loc. But the decl context is the closure. This behavior used
to cause crashes because 'receive { ... }' is re-typechecked.

For solution, when finding the innermost AST node, clear the found node
in parent context before walking into brace statement.

rdar://problem/69246891
2020-10-30 15:56:31 -07:00
..