use of org.eclipse.n4js.ts.typeRefs.TypeArgument in project n4js by eclipse.
the class InternalTypeSystem method substTypeVariablesImpl.
protected Result<TypeArgument> substTypeVariablesImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final ThisTypeRefStructural thisTypeRef) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeArgument> _result_ = applyRuleSubstTypeVariablesThisTypeRefStructural(G, _subtrace_, thisTypeRef);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("substTypeVariablesThisTypeRefStructural") + stringRepForEnv(G) + " |- " + stringRep(thisTypeRef) + " ~> " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleSubstTypeVariablesThisTypeRefStructural) {
substTypeVariablesThrowException(ruleName("substTypeVariablesThisTypeRefStructural") + stringRepForEnv(G) + " |- " + stringRep(thisTypeRef) + " ~> " + "ThisTypeRef", SUBSTTYPEVARIABLESTHISTYPEREFSTRUCTURAL, e_applyRuleSubstTypeVariablesThisTypeRefStructural, thisTypeRef, new ErrorInformation[] { new ErrorInformation(thisTypeRef) });
return null;
}
}
use of org.eclipse.n4js.ts.typeRefs.TypeArgument in project n4js by eclipse.
the class InternalTypeSystem method substTypeVariablesImpl.
protected Result<TypeArgument> substTypeVariablesImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final Wildcard wildcard) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeArgument> _result_ = applyRuleSubstTypeVariablesWildcard(G, _subtrace_, wildcard);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("substTypeVariablesWildcard") + stringRepForEnv(G) + " |- " + stringRep(wildcard) + " ~> " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleSubstTypeVariablesWildcard) {
substTypeVariablesThrowException(ruleName("substTypeVariablesWildcard") + stringRepForEnv(G) + " |- " + stringRep(wildcard) + " ~> " + "Wildcard", SUBSTTYPEVARIABLESWILDCARD, e_applyRuleSubstTypeVariablesWildcard, wildcard, new ErrorInformation[] { new ErrorInformation(wildcard) });
return null;
}
}
use of org.eclipse.n4js.ts.typeRefs.TypeArgument in project n4js by eclipse.
the class InternalTypeSystem method applyRuleTypeNewExpression.
protected Result<TypeRef> applyRuleTypeNewExpression(final RuleEnvironment G, final RuleApplicationTrace _trace_, final NewExpression e) throws RuleFailedException {
// output parameter
TypeRef T = null;
/* G |- e.callee: T */
Expression _callee = e.getCallee();
Result<TypeRef> result = typeInternal(G, _trace_, _callee);
checkAssignableTo(result.getFirst(), TypeRef.class);
T = (TypeRef) result.getFirst();
if ((T instanceof TypeTypeRef)) {
T = this.typeSystemHelper.createTypeRefFromStaticType(G, ((TypeTypeRef) T), ((TypeArgument[]) Conversions.unwrapArray(e.getTypeArgs(), TypeArgument.class)));
}
return new Result<TypeRef>(T);
}
use of org.eclipse.n4js.ts.typeRefs.TypeArgument in project n4js by eclipse.
the class InternalTypeSystem method substTypeVariablesImpl.
protected Result<TypeArgument> substTypeVariablesImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final FunctionTypeExprOrRef typeRef) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeArgument> _result_ = applyRuleSubstTypeVariablesInFunctionTypeExprOrRef(G, _subtrace_, typeRef);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("substTypeVariablesInFunctionTypeExprOrRef") + stringRepForEnv(G) + " |- " + stringRep(typeRef) + " ~> " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleSubstTypeVariablesInFunctionTypeExprOrRef) {
substTypeVariablesThrowException(ruleName("substTypeVariablesInFunctionTypeExprOrRef") + stringRepForEnv(G) + " |- " + stringRep(typeRef) + " ~> " + "TypeRef", SUBSTTYPEVARIABLESINFUNCTIONTYPEEXPRORREF, e_applyRuleSubstTypeVariablesInFunctionTypeExprOrRef, typeRef, new ErrorInformation[] { new ErrorInformation(typeRef) });
return null;
}
}
Aggregations