You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// (considering -> $T1 conforms to P [[locator@0x11d9ac6d8 [DeclRef@/Users/nuriamari/git/swift-project/swift/test/Constraints/scratch.swift:10:3 -> opened generic -> type parameter requirement #0 (conformance)]]];
7976
+
// (simplification result:
7977
+
// (attempting fix [fix: add missing protocol conformance] @ locator@0x11d9ac6d8 [DeclRef@/Users/nuriamari/git/swift-project/swift/test/Constraints/scratch.swift:10:3 -> opened generic -> type parameter requirement #0 (conformance)])
7978
+
// (increasing 'applied fix' score by 1)
7979
+
// (removed constraint: $T1 conforms to P [[locator@0x11d9ac6d8 [DeclRef@/Users/nuriamari/git/swift-project/swift/test/Constraints/scratch.swift:10:3 -> opened generic -> type parameter requirement #0 (conformance)]]];)
7980
+
// )
7981
+
// (outcome: simplified)
7982
+
// )
7983
+
// (Changes:
7984
+
// (Newly Bound:
7985
+
// > $T1 := (P)
7986
+
// )
7987
+
// (Removed Constraint:
7988
+
// > $T1 conforms to P [[locator@0x11d9ac6d8 [DeclRef@/Users/nuriamari/git/swift-project/swift/test/Constraints/scratch.swift:10:3 -> opened generic -> type parameter requirement #0 (conformance)]]];
// In this method, we are simplifying the `$T1 conforms to P` constraint. As a result of the above disjunction, we have `any P`, that is existential P as a fixed type for $T1.
7996
+
// Unless we open this existential, we will never pass the above lookup conformance and continue to report the `MissingConformance` fix.
7997
+
//
7998
+
// By opening the existential, I have removed all errors from the test case, which obviously isn't what we want. We want to only open
7999
+
// the existential when we are trying to bind `(any P)? to ($T1)?` and we've recorded a `ForceOptional` fix. The trouble is I don't have
8000
+
// enough context here to know this. I don't know how we arrived at `any P` as a fixed type for `$T1`.
8001
+
//
8002
+
// It seems like this change needs to be made elsewhere, but I'm not sure where. A method like `matchDeepEqualityTypes` gives us more context,
8003
+
// but I'm not sure how to safely persist the opening of the existential until the conformance lookup above. Conceptually
8004
+
// I understand that we are opening the existential so we can bind its underlying type to $T1, but I don't really understand
8005
+
// what lasting side effects the below call to `openExistentialType` has on the constraint system if any.
8006
+
8007
+
if (shouldAttemptFixes()) {
8008
+
if (type->isExistentialType()) {
8009
+
type = openExistentialType(type, loc).first;
8010
+
8011
+
auto conformance = DC->getParentModule()->lookupConformance(
0 commit comments