Example #1
0
 /**
  * Check that t1 :> t2 or, equivalently, that t2 is a subtype of t1. A type
  * <code>t1</code> is said to be a subtype of another type <code>t2</code>
  * iff the semantic set described by <code>t1</code> contains that described
  * by <code>t2</code>.
  *
  * @param t1
  *            --- Semantic type that should contain <code>t2</code>.
  * @param t2
  *            --- Semantic type that shold be contained by <code>t1/code>.
  * @param element
  *            --- Syntax error is reported against this element if
  *            <code>t1</code> does not contain <code>t2</code>.
  */
 private void checkIsSubtype(SemanticType t1, SemanticType t2, SyntacticElement element) {
   if (!SemanticType.isSubtype(t1, t2)) {
     syntaxError("expected type " + t1 + ", got type " + t2, filename, element);
   }
 }