add comment about checking required range in apply

This commit is contained in:
Ramon Boss 2019-07-03 11:55:15 +02:00
parent ffcfe360a6
commit b3cdb6015c

View File

@ -34,7 +34,10 @@ sealed abstract class Number[T <: Number[T]]
*/
def andMask: BigInt
/** Factory function to create the underlying T, for instance a UInt32 */
/**
* Factory function to create the underlying T, for instance a UInt32.
* This method must check if the parameter is in the required range.
*/
def apply: A => T
override def +(num: T): T = apply(underlying + num.underlying)