Skip to content

Conversation

@slavapestov
Copy link
Contributor

@slavapestov slavapestov commented Jan 20, 2017

In Swift 3, we had a bug where you could provide argument labels
to a function call taking a single Any parameter, even if the
parameter did not have a label.

This mostly worked (with asserts off!) but in fact it would crash
in SILGen if you were calling an enum case constructor.

Since this 'feature' has been promoted from 'works on accident' to
'still a hack but guarded by Swift 3 mode and exists on purpose',
fix the crash, even though Swift 3 could not compile the code in
question.

Also add a Swift 3 mode check to the earlier SILGen hack, so that
when/if we remove Swift 3 mode it will be obvious that this code is
now dead too.

… Any' thing

In Swift 3, we had a bug where you could provide argument labels
to a function call taking a single Any parameter, even if the
parameter did not have a label.

This mostly worked (with asserts off!) but in fact it would crash
in SILGen if you were calling an enum case constructor.

Since this 'feature' has been promoted from 'works on accident' to
'still a hack but guarded by Swift 3 mode and exists on purpose',
fix the crash, even though Swift 3 could not compile the code in
question.

Also add a Swift 3 mode check to the earlier SILGen hack, so that
when/if we remove Swift 3 mode it will be obvious that this code is
now dead too.
@slavapestov
Copy link
Contributor Author

@swift-ci Please smoke test

@xedin
Copy link
Contributor

xedin commented Jan 20, 2017

The gift that keeps on giving... :(

@slavapestov
Copy link
Contributor Author

Hey, we're not introducing regressions, we're identifying bogus behavior and isolating it behind that flag. Progress :-)

@slavapestov slavapestov merged commit f69efcd into swiftlang:master Jan 20, 2017
@xedin
Copy link
Contributor

xedin commented Jan 20, 2017

Absolutely! :)

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