Skip to content

[ConstraintSystem] Only attempt to infer a type from a default argument if there is a non-null callee. #42022

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
merged 2 commits into from
Mar 25, 2022

Conversation

hborla
Copy link
Member

@hborla hborla commented Mar 25, 2022

Otherwise, getParameterList(callee) will crash if the callee is a closure. Closures can't have default arguments anyway, so there's no need to attempt this new inference.

if there is a non-null callee.

Otherwise, getParameterList(callee) will crash if the callee is a closure.
Closures can't have default arguments anyway, so there's no need to
attempt this new inference.
@hborla hborla requested a review from xedin March 25, 2022 06:28
Copy link
Contributor

@xedin xedin left a comment

Choose a reason for hiding this comment

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

Thank you!

is no parameter list for the callee.

This can happen when the callee is a closure that has been assigned to
a variable.
@hborla
Copy link
Member Author

hborla commented Mar 25, 2022

@swift-ci please smoke test

@hborla
Copy link
Member Author

hborla commented Mar 25, 2022

@swift-ci please smoke test macOS

@xedin xedin merged commit 8506d9d into swiftlang:main Mar 25, 2022
@hborla hborla deleted the default-argument-fixes branch June 28, 2022 01:07
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