-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Introduce Transparent
flag
#10458
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
Introduce Transparent
flag
#10458
Conversation
3d50803
to
5cc1218
Compare
16d031b
to
6d5b5cd
Compare
Let the `transparent` modifier translate to it. allow `transparent` on traits and inline methods only.
For the moment, keep it in src-non-bootstrapped
Make infix a flag instead of an annotation.
861d32c
to
f08f00c
Compare
* are not inferred when combined with other types in an intersection. | ||
* See reference/other-new-features/transparent-traits.html for details. | ||
*/ | ||
final class transparentTrait extends StaticAnnotation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the use cases for this feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially cross-compilation. stdLib213 already contains 9 traits that are annotated with @transparentTrait
. Right now, we treat them also specially in a "assume transparent" set. But once we can backport the code into the standard library, we can drop that special treatment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue seems to be that we won't be able to drop the annotation itself. I'm not sure if that is a good idea.
@@ -196,22 +194,22 @@ package object ops { | |||
* val b: false ^ true = true | |||
* ``` | |||
*/ | |||
@infix type ^[X <: Boolean, Y <: Boolean] <: Boolean | |||
type ^[X <: Boolean, Y <: Boolean] <: Boolean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are these not infix?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They don't need to be since they are symbolic anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code LGTM. There is still a question about the annotation.
Let the
transparent
modifier translate to it. Allowtransparent
on traits andinline methods only.
Fixes #10457
Also, introduce
infix
as a modifier backed by a flag.Remove the @mixin and @infix annotations.