-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[NFC] TypeCheckType No Longer Returns Null #32321
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
Conversation
This method's only caller was using this to form a substituted DictionaryType, but also using TypeChecker::applyUnboundGenericArguments. We need to use the latter unconditionally so we actually check the requirements on DictionaryType and emit diagnostics. Also clean up resolveDictionaryType so it consistently returns ErrorTypes.
Directly return the parameter vector, and handle missing types the same way we handle error types.
Inline it into its only caller
Inline it into its only caller
@swift-ci smoke test |
@swift-ci test source compatibility |
@@ -7,4 +7,4 @@ protocol P1 { | |||
} | |||
extension Foo: P1 where A : P1 {} // expected-error {{unsupported recursion for reference to associated type 'A' of type 'Foo<T>'}} | |||
// expected-error@-1 {{type 'Foo<T>' does not conform to protocol 'P1'}} | |||
// expected-error@-2 {{type 'Foo<T>' in conformance requirement does not refer to a generic parameter or associated type}} | |||
// expected-error@-2 {{type '<<error type>>' in conformance requirement does not refer to a generic parameter or associated type}} |
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 did this change?
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.
Looks like the result of a !ty
-> ty->hasError()
transition somewhere in TypeCheckType.cpp
. The error message is bogus though, anyway..
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 second time we come around to add these requirements while computing the generic signature for the extension, the base is invalidated somewhere else in the stack. I think we should just not emit this diagnostic if the subject is an ErrorType
- it doesn't make sense here in the first place.
Lost connection to macOS nodes @swift-ci smoke test macOS |
Release builder died. @swift-ci test source compatibility Release |
@swift-ci smoke test macOS |
Make it structurally impossible for TypeCheckType to return the null type to both itself and its callers. A large amount of this is based on the work in #29780, but there's some additional deletions and structural assertions here.
Resolves SR-12085 and rdar://58879303