Skip to content

[Sema] Check existence of GenericSignature before getting GenericParamList from it #5773

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

Merged

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Nov 14, 2016

Fixes 2 compiler crashers.

@@ -23,6 +23,9 @@ public func twoGenericParams<T, U>(_ t: T, u: U) -> (T, U) {
return (t, u)
}

@_specialize(Int) // expected-error{{generic type 'nonGenericParam' specialized with too many type parameters (got 1, but expected 0)}}
func nonGenericParam(x: Int) {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message is incorrect (because @_specialize() is rejected).
But I don't think it's worth introducing a new diagnostic message just for this.

@rintaro
Copy link
Member Author

rintaro commented Nov 14, 2016

@swift-ci Please smoke test

@rintaro rintaro force-pushed the sema-typecheckattr-specialized branch from 4357d13 to 1b51bc1 Compare November 14, 2016 13:02
@rintaro
Copy link
Member Author

rintaro commented Nov 14, 2016

@swift-ci Please smoke test

@slavapestov slavapestov merged commit c6e3846 into swiftlang:master Nov 14, 2016
@rintaro rintaro deleted the sema-typecheckattr-specialized branch November 24, 2016 06:40
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.

2 participants