Skip to content

[GSB] Map invalid subject type to error type after resolving it#29813

Merged
theblixguy merged 1 commit into
swiftlang:masterfrom
theblixguy:fix/SR-12199
Feb 18, 2020
Merged

[GSB] Map invalid subject type to error type after resolving it#29813
theblixguy merged 1 commit into
swiftlang:masterfrom
theblixguy:fix/SR-12199

Conversation

@theblixguy
Copy link
Copy Markdown
Member

@theblixguy theblixguy commented Feb 13, 2020

In #29491, we mapped an invalid subject type to an error type, but only mapping it if the subject type isn't a dependent member type is not enough - it's possible we have a dependent member type initially, but resolving it leads to some other type. So, we should delay the mapping instead. Otherwise, we could crash in scenarios like:

protocol P {
  associatedtype Assoc
}

enum SomeEnum {}

protocol Q: P where Assoc == SomeEnum {
  associatedtype Assoc: SomeEnum // crash
}

@theblixguy theblixguy requested a review from CodaFi February 13, 2020 18:36
@theblixguy
Copy link
Copy Markdown
Member Author

@swift-ci please test

Comment thread lib/AST/GenericSignatureBuilder.cpp Outdated
@theblixguy
Copy link
Copy Markdown
Member Author

@swift-ci please smoke test

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.

3 participants