-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Make the cached mirror methods invisible #13825
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
Conversation
Sometimes the selected member exists but is not visible. In that case we should not issue a "did you mean" message with exactly the same name as what was written.
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 ordinal method should also be made invisible:
// Shape_1.scala
sealed trait Shape
object Shape:
case class Circle(r: Int) extends Shape
case class Square(width: Int) extends Shape
// Test_2.scala
val circleOrdinal = Shape.ordinal(Shape.Circle(r = 23))
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.
Just thinking now that the MirroredMonoType
is also visible too
Right. Fix is forthcoming. |
however I have thought of something else, which is that the companion will still extend 4 |val circleOrdinal = (Shape: deriving.Mirror.Sum).ordinal(Shape.Circle(r = 23)) // error
| ^^^^^^^^^^^^^^^^^^^^
| Found: Shape.Circle
| Required: ?1.MirroredMonoType
|
| where: ?1 is an unknown value of type deriving.Mirror.Sum could there be a way to make a parent invisible? |
| ^^^^^^^^^^^^^ | ||
| value ordinal is not a member of object Shape | ||
| ^^^^^^^^^^^^^^^^^^^^ | ||
| Found: Shape.Circle |
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.
this seems strange that making MirroredMonoType
invisible now makes ordinal
visible again
maybe this needs to be solved on the unpickling side - ignore the mirror parent in tasty (if it has invisible/synthetic mirror methods), then in posttyper re-add the parent |
I believe that would be a hole of complexity. |
I don't think so. I don't really want to sink more time into this. It is what it is. |
I think we should close this. I don't see a good way to address the issue currently. |
Fixes #13815