I am looking at the type hierarchy defined in NodeInfo and am confused about 
the Integer type.


In NodeInfo.scala we have:


    protected sealed trait IntegerKind extends SignedInteger.Kind
    case object Integer extends PrimTypeNode(Decimal, List(Long, 
NonNegativeInteger)) with IntegerKind {
      type Kind = IntegerKind
      override def fromXMLString(s: String) = new JBigInt(s)
    }

In the above code, the second line declares that Decimal is the parent type of 
Integer.

However, within the scala type-system, SignedInteger is the supertype of 
Integer (as declared in the first line).

My understanding is that the type hierarchy of NodeInfo is intended to match 
their Scala type hierarchy.


The context where this is coming up is that I need to find a type that will 
serve as a supertype (in the sense that NodeInfo defines) for all integer types.


Brandon T. Sloane

Associate, Services

[email protected] | tresys.com

Reply via email to