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

Fixes to usage of structural types in Scala 3 #2737

Merged

Conversation

WojciechMazur
Copy link
Contributor

@WojciechMazur WojciechMazur commented Jul 18, 2022

Fixes #2715
The fix involves skipping the casting of the arguments when it's not needed.
On top of fixes according to correct handling of primitive types, additional fixes to handling proxies using boxed types were added. It is needed to handle Scala 3 reflective access using selectable fully. Previously proxy types assumed target arguments should always be unboxed, this is however incorrect in Scala 3.

@WojciechMazur WojciechMazur merged commit 70a49c1 into scala-native:main Jul 19, 2022
@WojciechMazur WojciechMazur deleted the fix/structural-types-scala3 branch July 19, 2022 17:20
WojciechMazur added a commit to WojciechMazur/scala-native that referenced this pull request Aug 29, 2022
* Add reproducer for scala-native#2715

* Don't cast arguments of proxies if they already have correct type or when formal tyepe is primitive kind

* Fix generation of reflective proxy to handle structural types using boxed types

* Cleanup double definition in test
WojciechMazur added a commit to WojciechMazur/scala-native that referenced this pull request Aug 29, 2022
* Add reproducer for scala-native#2715

* Don't cast arguments of proxies if they already have correct type or when formal tyepe is primitive kind

* Fix generation of reflective proxy to handle structural types using boxed types

* Cleanup double definition in test
WojciechMazur added a commit to WojciechMazur/scala-native that referenced this pull request Aug 31, 2022
* Add reproducer for scala-native#2715

* Don't cast arguments of proxies if they already have correct type or when formal tyepe is primitive kind

* Fix generation of reflective proxy to handle structural types using boxed types

* Cleanup double definition in test
WojciechMazur added a commit that referenced this pull request Sep 1, 2022
* Add reproducer for #2715

* Don't cast arguments of proxies if they already have correct type or when formal tyepe is primitive kind

* Fix generation of reflective proxy to handle structural types using boxed types

* Cleanup double definition in test
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.

Structural type fails to compile in Scala 3
1 participant