You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've seen SI-8702 and friends, but feel like I'm hitting the same issue with an even simpler use-case.
Is it possible (in Scala 2.10) to have abstract members whose type is a value-class?
classFoo(valn:Int) extendsAnyValtraitBar { deffoo:Foo }
caseclassBaz(foo: Foo) extendsBar
<console>:9:error: bridge generated for member value foo: ()Foo in classBaz
which overrides value foo: ()Foo in traitBar
clashes with definition of the member itself;
both have erased type ()IntcaseclassBaz(foo: Foo) extendsBar
^
The text was updated successfully, but these errors were encountered:
@retronym said:
The problem here is an over-eager restriction, there is no fundamental reason that the compiler should not allow this. We fixed this in Scala 2.11 only, scala/scala#3082, so if you're stuck on 2.10, you might need to use a workaround. One such workaround would be to pass a parameter of type Some[Foo], rather than Foo, which effectively disables the value class optimization for that method signature.
I've seen SI-8702 and friends, but feel like I'm hitting the same issue with an even simpler use-case.
Is it possible (in Scala 2.10) to have abstract members whose type is a value-class?
The text was updated successfully, but these errors were encountered: