Skip to content
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

Tweak approximation of type variables when computing default types #18798

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

odersky
Copy link
Contributor

@odersky odersky commented Oct 30, 2023

Tweak approximation of type variables when computing the expected types of default arguments.

Fixes #18795

Tweak approximation of type variables when computing the expected types
of default arguments.

Fixes scala#18795
val approxTp = wildApprox(originalTp)
val approxTp = withMode(Mode.TypevarsMissContext):
// assert TypevarsMissContext so that TyperState does not leak into approximation
// We approximate precisely because we want to unlink the type variable. Test case is i18795.scala.
Copy link
Member

Choose a reason for hiding this comment

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

Does this sentence mean to describe the regular way approximation works, as in when TypevarsMissContext is not set, or am I misunderstanding?

@odersky odersky merged commit 7f803ec into scala:main Oct 31, 2023
18 checks passed
@odersky odersky deleted the fix-18795 branch October 31, 2023 11:04
@Kordyjan Kordyjan added this to the 3.4.0 milestone Dec 20, 2023
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.

default value for a function parameter - the compiler complains about the type, but the type is correct
3 participants