Skip to content

Fix #8856: Keep transparent flag #8857

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

Closed
wants to merge 2 commits into from

Conversation

nicolasstucki
Copy link
Contributor

No description provided.

@nicolasstucki nicolasstucki self-assigned this May 1, 2020
@nicolasstucki nicolasstucki linked an issue May 1, 2020 that may be closed by this pull request
@nicolasstucki nicolasstucki removed their assignment May 1, 2020
@nicolasstucki nicolasstucki marked this pull request as ready for review May 1, 2020 14:25
Copy link
Contributor

@odersky odersky left a comment

Choose a reason for hiding this comment

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

I don't know. I mean, it would have been much easier to spend a flag for Transparent but I invested quite a bit of time to avoid it! We should try to reign in the number of flags, in particular the ones that are pickled in TastyFormat.

Would it be possible to detect transparency by looking at the RHS? if it's a Typed node with the type of the result type the function is transparent.

@nicolasstucki
Copy link
Contributor Author

We cannot detect if a def is marked with transparent by looking it's RHS because it is ambiguous. Furthermore, we can't use that strategy to detect if a val was marked as transparent.

@nicolasstucki
Copy link
Contributor Author

The alternative would be to add an annotation.

@nicolasstucki nicolasstucki marked this pull request as draft May 1, 2020 16:26
@odersky
Copy link
Contributor

odersky commented May 2, 2020

What is a transparent val?

@odersky
Copy link
Contributor

odersky commented May 2, 2020

I am beginning to think that the whole introduction of transparent was a mistake. Maybe we should have stuck with the special type syntax? The problem with modifiers is feature creep - they tend to go everywhere.

@nicolasstucki
Copy link
Contributor Author

Still, we need a way for tools to know if an inline is transparent, regardless of the encoding.

@odersky
Copy link
Contributor

odersky commented May 2, 2020

Yes, but an inline could be declared transparent if its RHS is not a type ascription. The question is: can we always see that?

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.

Keep transparent modifier
2 participants