Open Mee-Tree opened 1 year ago
Example:
case class Type(name: String) @newtype case class Foo(value: List[Type]) val value: List[Type] = List(Type("abc")) Foo(value)
The code does not compile due to the following error:
type mismatch; found : List[Type] required: List[Foo.Type]
The simplest solution is to rename all type aliases to avoid the possibility of name collision (like prefixing them with $).
$
type $Base = ... type $Repr = ... type $Type = ... type $Tag = ...
Currently, as a workaround, the user can create an alias (if changing the name isn't an option), and the code would work as expected:
type TType = Type @newtype case class Foo(value: List[TType])
Example:
The code does not compile due to the following error:
The simplest solution is to rename all type aliases to avoid the possibility of name collision (like prefixing them with
$
).Currently, as a workaround, the user can create an alias (if changing the name isn't an option), and the code would work as expected: