Closed CodeLionX closed 6 years ago
Reasonable Implementation of Record
Record
scala.collection
TypedMap
TypedMapLike
TypedMapLike[K[+_ <: V], V, This <: ...]#apply[T <: V](k: K[T]): T
// FIXME
ColumnDef
K[+_ <: V]
ColumnDef[T]
ColumnDef[+T]
UntypedColumnDef
ColumnDef.UntypedColumnDef
ColumnDef[Any]
val col: ColumnDef[Int] = ColumnDef[Int]("col_name") val col = ColumnDef[Int]("col_name")
otherwise scalac does not find the right implicit for the default value. Call the ColumnDef-factory always with explicit type-parameter!
Codacy is not working! :disappointed:
@srfc please review PR #102 as this one is already closed. It contains the changes you requested!
Proposed Changes
Reasonable Implementation of
Record
scala.collection
APITypedMap
as a base-implementation for maps with key/value bindings, where the key contains type-information about the valueTypedMapLike
, eg.Record
s as they implementTypedMapLike
// FIXME
or unimplemented methods!ColumnDef
were necessary:TypedMapLike
defines its key's type-parameter covariant:K[+_ <: V]
(semantic of maps!)ColumnDef[T]
must be changed to be covariant, too:ColumnDef[+T]
UntypedColumnDef
anymore as it contained a type-parameter, which is per definition invariantColumnDef.UntypedColumnDef
=ColumnDef[Any]
can be seamlessly substituted for the old classotherwise scalac does not find the right implicit for the default value. Call the
ColumnDef
-factory always with explicit type-parameter!