示例#1
0
 @Override
 public Type instantiate(Type t) throws SemanticException {
   Type n = super.instantiate(t);
   // Also check that the name is simple.
   if (n instanceof MacroType) {
     MacroType mt = (MacroType) n;
     if (mt.formalTypes().size() != 0) return null;
     if (mt.typeParameters().size() != 0) return null;
   }
   // Need to replace the outer type of n with container.
   // container may have clauses that need to be part of n.
   // e.g. A{self.i==3}.Inner will return A.Inner{A.self.i==3}.
   n = Types.addInOuterClauses(n, container);
   return n;
 }