Class NominalSuperTypeCalculator


  • public class NominalSuperTypeCalculator
    extends java.lang.Object
    • Constructor Detail

      • NominalSuperTypeCalculator

        public NominalSuperTypeCalculator()
    • Method Detail

      • getNominalSuperTypes

        public java.util.List<SymTypeExpression> getNominalSuperTypes​(SymTypeExpression thisType)
        supertypes, but modified according to type parameters. Practically, this is meant to be used with object types including generics. This returns the list of nominal supertypes, e.g., in Java using extends / implements e.g. Collection<Integer> is an explicit super type of List<Integer>, List<? super Integer> is a super type of List<Integer>, but not an explicitly defined one. We consider explicitly defined super types to be the ones given by the list of super types in the type symbol.

        "nominal" supertypes in that the superTypes are explicitly "named"/listed, it is NOT required that they have a name themselves; This does not quite but mostly fit the following definition: Pierce, Types and Programming Languages (chapter 19.3): """ Type systems like Java's, in which names are significant and subtyping is explicitly declared, are called nominal. Type systems [...] in which names are inessential and subtyping is defined directly on the structures of types are called structural. """