-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Sould infix
work on enum
?
#18933
Comments
I assume it should be allowed. @odersky is this the case? |
I think we should allow it. |
doesn't this need a SIP? |
I don't think so. It looks to me light an oversight of the implementation. It's not like when we examined |
the linked PR #19010 doesnt enable this, but should we also allow infix enum cases? e.g. import Expr.*
enum Expr[+A]:
infix case to[A <: Int, B <: Int](min: A, max: B) extends Expr[Range]
extension [A <: Int](min: A)
infix def to[B <: Int](max: B): A to B = Expr.to(min, max)
val foos: 1 to 23 = 1 to 23 |
They declare class types, so IMO yes. |
Some enum cases declare class types, but not all. So we'd have to restrict it to those cases that actually do declare class types. |
Compiler version
3.3
Minimized example
but
Question
Should infix work on
enum
to mark it as an infix type?The text was updated successfully, but these errors were encountered: