Commit Graph

11 Commits

Author SHA1 Message Date
Allan Shortlidge
87308e37f1 AST: Avoid creating duplicate AvailabilityScopes under SequenceExprs.
Since availability scopes may be built at arbitrary times, the builder may
encounter ASTs where SequenceExprs still exist and have not been folded, or it
may encounter folded SequenceExprs that have not been removed from the AST.

To avoid a double visit, track whether a SequenceExpr is folded and then
customize how ASTVisitor handles folded sequences.

Resolves rdar://142824799 and https://github.com/swiftlang/swift/issues/78567.
2025-01-17 10:21:22 -08:00
Hamish Knight
0fdb038fc9 Merge pull request #77896 from hamishknight/functionref-split
[AST] Split out "is compound" bit on FunctionRefKind
2024-12-03 09:53:37 +00:00
Hamish Knight
73fb36f371 [AST] Split out "is compound" bit on FunctionRefInfo
FunctionRefKind was originally designed to represent
the handling needed for argument labels on function
references, in which the unapplied and compound cases
are effectively the same. However it has since been
adopted in a bunch of other places where the
spelling of the function reference is entirely
orthogonal to the application level.

Split out the application level from the
"is compound" bit. Should be NFC. I've left some
FIXMEs for non-NFC changes that I'll address in a
follow-up.
2024-12-02 14:11:33 +00:00
Hamish Knight
a4d51419ba [AST] NFC: Rename FunctionRefKind -> FunctionRefInfo 2024-12-02 14:11:32 +00:00
Rintaro Ishizaki
bee4cfe3e5 [PreCheckTarget] Consider UnresolvedSpecializeExpr a chain expression
Optional chain and unresolved member chain should consider
a generic specialization as a chain expression.

rdar://140378864
2024-11-22 12:08:19 -08:00
Rintaro Ishizaki
ffeaa719ef [Sema] Ensure postfix operator is not a part of implicit member chain
But a part of optional chain.
2024-10-12 17:24:08 -07:00
Rintaro Ishizaki
8e8e4d0193 [Parse/Sema] Move OptionalEvaluationExpr wrapping to PreCheckTarget
This simplify the Parser diagnostics and some type checker logic.
2024-10-11 13:12:48 -07:00
Alejandro Alonso
0df42e9841 Lower UDRE to TypeValue if it references a value generic 2024-09-04 15:13:29 -07:00
Hamish Knight
89a3390aa1 [Sema] Move SingleValueStmtUsageChecker into pre-checking
These diagnostics are better suited for pre-checking
since we ought to be emitting them even if there's
some other error with the expression.
2024-08-30 18:55:48 +01:00
Hamish Knight
1139b0e799 Remove shouldWalkCaptureInitializerExpressions from PreCheckTarget
We walk into PatternBindingDecls, so I don't think
there should be any reason we can't walk captures
normally (i.e via their PBD).
2024-08-30 18:55:48 +01:00
Hamish Knight
f0e487dc81 NFC: Rename PreCheckExpression -> PreCheckTarget 2024-08-30 18:55:48 +01:00