Is it possible to define a bottom class in a sublattice of Scala's type hierarchy? -
say have abstract class a
. want define final class abot
such class b
extends a
(except nothing
), abot
subclass of b
. it's nothing
, respect hierarchy a
top.
answer no.
a class not subtype of x unless explicitly extend x.
scala.nothing
exception because scala compiler magic you.
Comments
Post a Comment