Skip to content

Conversation

hamishknight
Copy link
Contributor

This is useful for ArrowExpr when the sub-expressions aren't valid TypeExprs. Rather than throwing away the AST, attach it to the ErrorTypeRepr to ensure we can still type-check it. This ensures semantic functionality still works correctly, and fixes a crash where we'd stop visiting an invalid binding pattern, losing track of the nested VarDecl.

This is useful for ArrowExpr when the sub-expressions aren't valid
TypeExprs. Rather than throwing away the AST, attach it to the
ErrorTypeRepr to ensure we can still type-check it. This ensures
semantic functionality still works correctly, and fixes a crash where
we'd stop visiting an invalid binding pattern, losing track of the
nested VarDecl.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please SourceKit stress test

@hamishknight hamishknight merged commit 014ed51 into swiftlang:main Sep 12, 2025
6 checks passed
@hamishknight hamishknight deleted the times-arrow branch September 12, 2025 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants