Skip to content

Conversation

@gregomni
Copy link
Contributor

This fixes the crash in sr-114.

@gregomni
Copy link
Contributor Author

Adding constraints for the invalid operator decl means constraining to the error type, which fails an assertion later on while binding an overload choice. In all the normal function/method overload choice cases, if the decl is invalid that choice gets skipped (never generated), so this is just another case of the existing way of doing things.

@lattner
Copy link
Contributor

lattner commented Dec 11, 2015

Great catch. I'd suggest returning "Type()" when the decl is known invalid (mirroring the behavior in visitOverloadedMemberRefExpr around line 1312). Also, since the test case is small and should be fast to run, please add it to the non-validation test suite, I'd suggest in test/decl/subscript/subscripting.swift.

Thank you for tracking this down and fixing it!

@lattner lattner self-assigned this Dec 11, 2015
@gregomni
Copy link
Contributor Author

Sure thing! Here's a second commit with your suggestions. If it looks good, let me know, and I'll squash the two.

This fixes the crash in sr-114. Adding constraints for the invalid operator decl means constraining to the error type, which fails an
assertion later on while binding an overload choice. In all the normal function/method overload choice cases, if the decl is invalid
that choice gets skipped (never generated), so this is just another case of the existing way of doing things
@gregomni
Copy link
Contributor Author

Actually, just went ahead and squashed because hopefully this is the final change needed.

@lattner
Copy link
Contributor

lattner commented Dec 11, 2015

Totally awesome, thank you!

lattner added a commit that referenced this pull request Dec 11, 2015
Don't add constraints for invalid subscript declarations.
@lattner lattner merged commit 8f15815 into swiftlang:master Dec 11, 2015
@lattner
Copy link
Contributor

lattner commented Dec 11, 2015

Also, please do the honors of closing SR-114! :-)

@gregomni gregomni deleted the sr-114 branch May 30, 2016 01:11
slavapestov pushed a commit to slavapestov/swift that referenced this pull request Nov 27, 2018
build: link against swiftOnoneSupport in debug configuration
freak4pc pushed a commit to freak4pc/swift that referenced this pull request Sep 28, 2022
…d-actions-have-a-configuration-field

Don't assume all xfailed actions have a 'configuration' specified
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