-
Notifications
You must be signed in to change notification settings - Fork 31
Dealing with NoClassTag when converting to arraysΒ #69
Copy link
Copy link
Open
Description
Hello π
I have a very simple case and I couldn't find documentation on how to deal with this π€·ββοΈ
I've declared a new type like this:
@newtype final case class Id(value: String)
@newtype final case class ExternalId(value: String)Later in the code I finish up with a map mapping: Map[Id, ExternalId]. But when I need to collect it's keys/values to an array I get compilation errors:
val myIds = mapping.keys.toArray
val externalIds = mapping.values.toArrayError:
No ClassTag available for ...Id
No ClassTag available for ...ExternalIdHow is this supposed to be handled. Are newtypes incompatible with arrays because of generics?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels