Commit Graph

1572 Commits

Author SHA1 Message Date
swift-ci
9be21897d9 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-19 15:20:12 -07:00
Hamish Knight
0b3747d7c4 Revert "[CS] Record fix when encountering decl reference with placeholder type"
This reverts commit 8102e39f39.
2025-09-19 14:22:39 +01:00
swift-ci
3ac38cb3c4 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-18 21:16:38 -07:00
Slava Pestov
9dea72579a Sema: Record ASTNode type changes in PreparedOverload
Also, move some methods from ConstraintSystem.h to ConstraintSystem.cpp.
2025-09-18 14:54:16 -04:00
Slava Pestov
a12c160d0b Sema: Replace calls to OverloadChoice constructor with two overloads of getDecl() 2025-09-18 14:54:16 -04:00
Slava Pestov
b181fcf0fd Sema: Get prepared overloads working again with the Pre()/Post() split 2025-09-18 14:54:16 -04:00
Slava Pestov
c344d6b0eb Sema: Rename getTypeOf{Member,}ReferenceImpl() to Pre() and factor out Post() versions 2025-09-18 11:31:59 -04:00
Slava Pestov
182c38470b Sema: Remove replacementsPtr parameter from getTypeOfMemberReference() 2025-09-18 11:31:59 -04:00
Slava Pestov
a028eb36b7 Sema: Don't need to return new baseObjTy from getTypeOfMemberReferenceImpl() 2025-09-18 11:31:59 -04:00
Slava Pestov
d8ead6c5cc Sema: Refactor getTypeOf{Member,}Reference() to take the OverloadChoice 2025-09-18 11:31:59 -04:00
Slava Pestov
2fde4a50e7 Sema: Split off getTypeOfMemberReferenceImpl() from getTypeOfMemberReference() 2025-09-18 11:06:32 -04:00
Slava Pestov
35a439de24 Sema: Remove replacements parameter from getMemberReferenceTypeFromOpenedType() 2025-09-18 11:06:31 -04:00
Slava Pestov
1efc9a6d0d Sema: Split off getTypeOfReferenceImpl() from getTypeOfReference() 2025-09-18 11:06:31 -04:00
swift-ci
7b8b46694b Merge remote-tracking branch 'origin/main' into rebranch 2025-09-18 06:36:53 -07:00
Hamish Knight
deab5f7970 Merge pull request #84280 from hamishknight/csapply-cleanup
Reapply: [Sema] Remove some unreachable code from CSApply
2025-09-18 14:25:51 +01:00
swift-ci
9e3d4161b5 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-18 05:03:55 -07:00
Hamish Knight
8102e39f39 [CS] Record fix when encountering decl reference with placeholder type
We allow placeholder types in interface types in certain cases to allow
better recovery since we can suggest the inferred type as a replacement.
When referencing those decls though we need to make sure we record a fix
since we cannot form a valid solution with them.
2025-09-17 20:51:06 +01:00
Hamish Knight
782a5b4332 [CS] Ensure we trap in getOverloadChoice if the overload is missing
Using `*` previously meant we'd invoke undefined behavior.
2025-09-17 16:11:53 +01:00
swift-ci
95736f8e88 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-10 01:39:11 -07:00
Hamish Knight
f8218e3254 Merge pull request #83777 from hamishknight/ext-cleanup
[Sema] Clean up extension binding a little
2025-09-10 09:37:20 +01:00
swift-ci
d71d1eec81 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-09 23:47:19 -07:00
Slava Pestov
60246a2889 Sema: Further split up getTypeOfMemberTypeReference() 2025-09-09 18:58:10 -04:00
Slava Pestov
6dc2e7558d Sema: Don't modify openedType in getMemberReferenceTypeFromOpenedType() 2025-09-09 18:58:09 -04:00
Hamish Knight
d9d0b2e6a3 [Sema] Make extension binding lazy for SourceLoader
This will mainly be useful once extension binding is fully
requestified, but even now it's a good idea to ensure module loading
isn't kicking name lookup.
2025-09-09 23:18:52 +01:00
swift-ci
a4df245f2e Merge remote-tracking branch 'origin/main' into rebranch 2025-09-07 10:57:49 -07:00
Hamish Knight
4d1a04b856 [CS] Remove AllowUnresolvedTypeVariables (#84146)
This has been unused for a while now.
2025-09-07 18:36:01 +01:00
Hamish Knight
23560df5f4 [CS] Remove AllowUnresolvedTypeVariables
This has been unused for a while now.
2025-09-07 12:17:18 +01:00
swift-ci
c1422827de Merge remote-tracking branch 'origin/main' into rebranch 2025-09-07 01:40:20 -07:00
Hamish Knight
71d825dcb8 [CS] NFC: Remove CTP_ForEachStmt 2025-09-05 22:20:28 +01:00
swift-ci
7563fa5023 Merge remote-tracking branch 'origin/main' into rebranch 2025-09-01 14:03:12 -07:00
Hamish Knight
0142d0b92e [CS] Add debug message when hitting too complex limit
Add a message to the constraints debugging log when hitting one of the
complexity limits.
2025-09-01 13:33:47 +01:00
swift-ci
69e3469a9f Merge remote-tracking branch 'origin/main' into rebranch 2025-08-31 03:55:05 -07:00
Hamish Knight
d7fea157a1 [IDE] Remove fallback type-checking logic
This should no longer be necessary, rip it out.
2025-08-30 14:08:42 +01:00
swift-ci
605811fda2 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-29 00:13:26 -07:00
Hamish Knight
5b8dfc70ab [CS] Emit fallback diagnostic if needed for IgnoreInvalidASTNode
If no other error has been emitted, make sure we emit a fallback
diagnostic rather than crashing in the ASTVerifier or SILGen.
2025-08-28 15:31:48 +01:00
swift-ci
a6fefc8965 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-27 15:53:05 -07:00
Hamish Knight
9c898206e8 Merge pull request #83870 from hamishknight/overrun
[CS] Open generic requirements for types with unbound + placeholder types
2025-08-27 23:20:33 +01:00
swift-ci
ad77040115 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-27 15:00:58 -07:00
Felipe Mussi Ferreira Peixoto
9779591212 [CSDiagnostics] Prevent nested type references in KeyPath components (#83625)
This change adds detection for nested type references in KeyPath
components and applies the appropriate fix to generate meaningful error
messages, following the same pattern already established for method
references.

The fix ensures that invalid KeyPath references fail gracefully in
normal mode and provide helpful diagnostics in diagnostic mode,
improving the developer experience when working with KeyPaths.

Resolves: https://github.com/swiftlang/swift/issues/83197
2025-08-27 14:50:14 -07:00
Hamish Knight
2e0be5afd7 [CS] Open generic requirements for types with unbound + placeholder types
- Introduce a generic requirements opening function for type resolution,
  which is used by the constraint system in cases where we need to
  impose requirements on opened type variables.
- Refactor `replaceInferableTypesWithTypeVars` to use this function
  when opening generic types that contain either placeholder or unbound
  generic types.

Together these changes ensure that we don't drop generic requirements
when an unbound generic or placeholder type is used as a generic
argument.
2025-08-26 12:16:54 +01:00
swift-ci
35ec5d8cf8 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-25 19:57:31 -07:00
Slava Pestov
1972c4845f Sema: Cache result of getUnsatisfiedAvailabilityConstraint()
This query is expensive and we call it a lot.
2025-08-25 17:14:35 -04:00
swift-ci
837895af84 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-16 06:13:25 -07:00
Slava Pestov
a983323508 Merge pull request #83768 from slavapestov/replace-covariant-result-type
Sema: Remove a bunch of usages of replaceCovariantResultType()
2025-08-16 08:56:12 -04:00
swift-ci
7af6a24faf Merge remote-tracking branch 'origin/main' into rebranch 2025-08-15 21:36:20 -07:00
Hamish Knight
4423399fce [CS] Use apply component locator for verifyThatArgumentIsHashable
For a method key path use the locator for the apply itself rather
than the member, ensuring we handle invalid cases where the apply is
the first component, and providing more accurate location info.
2025-08-15 21:30:22 +01:00
Slava Pestov
a399c46db7 Sema: Pull preconcurrency adjustment out of getUnopenedTypeOfReference() 2025-08-15 14:39:14 -04:00
swift-ci
b1f090e3e8 Merge remote-tracking branch 'origin/main' into rebranch 2025-08-02 08:55:07 -07:00
Hamish Knight
fb7f2d0ff2 [CS] Limit the number of chained @dynamicMemberLookup lookups
Set an upper bound on the number of chained lookups we attempt to
avoid spinning while trying to recursively apply the same dynamic
member lookup to itself.

rdar://157288911
2025-08-01 19:08:04 +01:00
swift-ci
3998a187f9 Merge remote-tracking branch 'origin/main' into rebranch 2025-07-30 09:36:41 -07:00