}
// isSubtypeOf does not know about concrete syntax types
// so deal with it here explicitly
if (declaredType instanceof NonTerminalType) {
Type subjectType = subject.getValue().getType();
if (subjectType.isSubtypeOf(Factory.Tree) && ((IConstructor)subject.getValue()).getConstructorType() == Factory.Tree_Appl) {
IConstructor tree = (IConstructor)subject.getValue();
NonTerminalType nt = (NonTerminalType)declaredType;
IConstructor declaredSymbol = nt.getSymbol();
Type subjectNT = RascalTypeFactory.getInstance().nonTerminalType(tree);
if(subjectNT.isSubtypeOf(nt)) {
if(TreeAdapter.isList(tree)) {
if(TreeAdapter.getArgs(tree).isEmpty()) {
if(SymbolAdapter.isIterPlus(declaredSymbol) || (SymbolAdapter.isIterPlusSeps(declaredSymbol))) {
return false;
}
}
}
if(anonymous) {
return true;
}
ctx.getCurrentEnvt().declareAndStoreInferredInnerScopeVariable(name, ResultFactory.makeResult(declaredType, subject.getValue(), ctx));
this.alreadyStored = true;
return true;
}
}
return false;
}
Type tmp;
if (subject.getValue().getType().isSubtypeOf(declaredType)) {
if(debug)System.err.println("matches");
try {
// type checking code for formal parameters; the static type of the actual should be a sub-type of the type of the formal