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
Sorry, this isn't an issue as such, I was just looking for more information on how newtype works. The README says something like this is generated:
package object types {
type WidgetId = WidgetId.Type
object WidgetId {
type Repr = Int
type Base = { type WidgetId$newtype }
trait Tag
type Type <: Base with Tag
def apply(x: Int): WidgetId = x.asInstanceOf[WidgetId]
implicit final class Ops$newtype(val $this$: Type) extends AnyVal {
def toInt: Int = $this$.asInstanceOf[Int]
}
}
}
I get the basic idea that you use macros to generate a value class but I wasn't sure why so many intermediate types are defined or what type Base = { type WidgetId$newtype }, which looks abstract, did?
Any more info would be much appreciated, thanks!!!
The text was updated successfully, but these errors were encountered:
Sorry, this isn't an issue as such, I was just looking for more information on how newtype works. The README says something like this is generated:
I get the basic idea that you use macros to generate a value class but I wasn't sure why so many intermediate types are defined or what
type Base = { type WidgetId$newtype }
, which looks abstract, did?Any more info would be much appreciated, thanks!!!
The text was updated successfully, but these errors were encountered: