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

Remove compiletime.Widen #11569

Merged
merged 1 commit into from
Mar 8, 2021

Conversation

nicolasstucki
Copy link
Contributor

This was a workaround to some limitations of type inference.

@nicolasstucki nicolasstucki marked this pull request as ready for review March 1, 2021 17:34
val res =
inline erasedValue[T] match
case _: EmptyTuple => EmptyTuple
case _: (t *: ts) => constValue[t] *: constValueTuple[ts]
end match
res.asInstanceOf[Widen[T]]
res.asInstanceOf[T]
Copy link
Member

Choose a reason for hiding this comment

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

Is that cast actually still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, before inlining the type of res is Tuple.

Copy link
Member

Choose a reason for hiding this comment

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

Can these two be implemented in terms of map, which already deals with casting it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The issue is that we do not have a tuple on which we could call map.

@nicolasstucki nicolasstucki added the release-notes Should be mentioned in the release notes label Mar 2, 2021
@dwijnand

This comment has been minimized.

@smarter smarter added this to the 3.0.0-RC2 milestone Mar 8, 2021
@smarter smarter merged commit 22a9a5a into scala:master Mar 8, 2021
@smarter smarter deleted the remove-compiletime-Widen branch March 8, 2021 20:34
@nicolasstucki nicolasstucki changed the title Try to remove compiletime.Widen Remove compiletime.Widen Mar 30, 2021
vincenzobaz added a commit to scalacenter/scio that referenced this pull request Apr 7, 2021
vincenzobaz added a commit to scalacenter/scio that referenced this pull request Apr 7, 2021
MaximeKjaer pushed a commit to scalacenter/scio that referenced this pull request Apr 12, 2021
MaximeKjaer pushed a commit to scalacenter/scio that referenced this pull request Apr 19, 2021
MaximeKjaer pushed a commit to scalacenter/scio that referenced this pull request May 5, 2021
@Kordyjan Kordyjan modified the milestones: 3.0.0-RC2, 3.0.0 Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes Should be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants