Class TypeCompatibilityBound

java.lang.Object
de.monticore.types3.generics.bounds.Bound
de.monticore.types3.generics.bounds.TypeCompatibilityBound
All Implemented Interfaces:
Comparable<Bound>

public class TypeCompatibilityBound extends Bound
Specifies, that either A) the inference variable is compatible to the SymTypeExpression, or B) the specified SymTypeExpression is compatible to inference variable. s.a. TypeCompatibilityConstraint s.a. SubTypingBound

This bound does not exist in the Java language specification. Instead, the corresponding TypeCompatibilityConstraint in Java is reduced to a SubTypingBound. As our Type System is (slightly) less restrictive with A) what types can be used as type arguments, and B) which types are compatible to another, using a SubTypingBound would be too restrictive, e.g., (Bad example, only used for simplicity) List<Integer> l1 = [1]; List<int> l2 = [1]; The above example cannot be type-checked with the standard JLS algorithm.

Note: As of writing, replacing every creation of these with the creation of a SubTypingBound, the implementation should behave very comparable to JLS 21 chapter 18.