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
scala>traitCurrency[T<:Currency[T]] {
defamount:BigDecimaldefcopy(amount: BigDecimal):Tdef+(other: T) = copy(amount + other.amount)
}
scala>caseclassSEK(amount: BigDecimal) extendsCurrency[SEK]
<console>:8:error: classSEK needs to be abstract, since method copy in traitCurrency of type (amount: BigDecimal)SEK is not defined
caseclassSEK(amount: BigDecimal) extendsCurrency[SEK]
However:
scala>caseclassSEK(amount: BigDecimal)
defined classSEK
scala>:javap SEKCompiled from "<console>"
public classSEKextends java.lang.Object implements scala.ScalaObject,scala.Product,scala.Serializable{
[snip]
public SEK copy(scala.math.BigDecimal);
[snip]
}
The text was updated successfully, but these errors were encountered:
However:
The text was updated successfully, but these errors were encountered: