Newsubtype

abstract class Newsubtype[Src] extends NewsubtypeTrait[Src]

Like Newtype, except as a subtype of the underlying type instead of as an entirely new type.

 type Level = Level.Type
 object Level extends NewsubtypeWrapped[Int]

 val level1: Level = Level(1)
 // This works too
 val level2: Int = Level(2)
 // This fails compilation
 // val level3: Level = 3
trait NewsubtypeTrait[Src]
trait NewEncoding[Src]
class Object
trait Matchable
class Any

Type members

Inherited types

override opaque type Type
Inherited from:
NewsubtypeTrait

Value members

Inherited methods

final inline protected def derive[F[_]](implicit ev: F[Src]): F[Type]
Inherited from:
NewEncoding
final inline protected def unsafeCoerce(value: Src): Type
Inherited from:
NewEncoding

Extensions

Inherited extensions

extension (self: Type)
final inline def value: Src
Inherited from:
NewEncoding

Implicits

Inherited implicits

implicit val codec: Aux[Type, Src]
Inherited from:
NewEncoding
implicit val typeInfo: TypeInfo[Type]
Inherited from:
NewEncoding