-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sema: Do not drop reference to type paramater if it reduces to ErrorType
#79065
base: main
Are you sure you want to change the base?
Conversation
@swift-ci please smoke test |
Given the original bug report:
I think the actual bug here is that we end up in CSApply even when the code was invalid. We should never have a DependentMemberType with a concrete base type like that. |
struct G<T> {} | ||
|
||
protocol P { | ||
associatedtype A where A == Undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the behavior here any different than the case where Undefined
exists?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I think about it is that if reduction returns an error type, then it makes sense to ignore the constraint that caused it to error out. That is, to not treat that error type as concrete when searching for type parameter references.
I will have a look at what the erasure algorithm is doing. |
This is why we end up with up with an archetype base: swift/lib/Sema/ConstraintSystem.cpp Lines 1695 to 1700 in 42f0b89
|
Perhaps we shouldn’t proceed to CSApply if there are type variables with fixed types that contain dependent member types? We can treat them like free type variables perhaps. |
Resolves #77840.