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

empty instantiations of self types #1383

Open
gavinking opened this issue Jul 17, 2015 · 2 comments
Open

empty instantiations of self types #1383

gavinking opened this issue Jul 17, 2015 · 2 comments

Comments

@gavinking
Copy link
Member

We could add some reasoning around types like Comparable<Anything> which are empty due to the self type constraint. Perhaps just say that Nothing covers Comparable<Anything>, since I'm not sure if saying Comparable<Anything> is exactly Nothing would be decidable.

These case is distinguishable because:

  • the type parameter is a self type and is not covariant, and
  • the type argument does not inherit the type (and is not marked out).
@gavinking gavinking self-assigned this Jul 17, 2015
@gavinking gavinking added this to the 1.2 milestone Jul 17, 2015
@RossTate
Copy link
Member

Is this practical? If I recall, the analysis you ran a while ago showed that no one uses self types in ways that would be relevant to this optimization.

@gavinking
Copy link
Member Author

Not sure if it's useful or not. But after looking at the code, there is no really obvious place to incorporate this reasoning without complicating the algorithms. So: not for 1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants