use of org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef in project n4js by eclipse.
the class InternalTypeSystem method thisTypeRefImpl.
protected Result<TypeRef> thisTypeRefImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final ParameterizedTypeRef type) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeRef> _result_ = applyRuleThisTypeRefParameterizedTypeRef(G, _subtrace_, type);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("thisTypeRefParameterizedTypeRef") + stringRepForEnv(G) + " |~ " + stringRep(type) + " ~> " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleThisTypeRefParameterizedTypeRef) {
thisTypeRefThrowException(ruleName("thisTypeRefParameterizedTypeRef") + stringRepForEnv(G) + " |~ " + stringRep(type) + " ~> " + "BoundThisTypeRef", THISTYPEREFPARAMETERIZEDTYPEREF, e_applyRuleThisTypeRefParameterizedTypeRef, type, new ErrorInformation[] { new ErrorInformation(type) });
return null;
}
}
use of org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef in project n4js by eclipse.
the class InternalTypeSystem method applyRuleTypeTSetter.
protected Result<TypeRef> applyRuleTypeTSetter(final RuleEnvironment G, final RuleApplicationTrace _trace_, final TSetter tsetter) throws RuleFailedException {
// output parameter
TypeRef T = null;
TypeRef _elvis = null;
TypeRef _declaredTypeRef = tsetter.getDeclaredTypeRef();
if (_declaredTypeRef != null) {
_elvis = _declaredTypeRef;
} else {
ParameterizedTypeRef _anyTypeRef = RuleEnvironmentExtensions.anyTypeRef(G);
_elvis = _anyTypeRef;
}
T = _elvis;
return new Result<TypeRef>(T);
}
use of org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef in project n4js by eclipse.
the class InternalTypeSystem method applyRuleTypeNumericLiteral.
protected Result<TypeRef> applyRuleTypeNumericLiteral(final RuleEnvironment G, final RuleApplicationTrace _trace_, final NumericLiteral l) throws RuleFailedException {
// output parameter
TypeRef T = null;
ParameterizedTypeRef _xifexpression = null;
boolean _isIntLiteral = N4JSLanguageUtils.isIntLiteral(l);
if (_isIntLiteral) {
_xifexpression = RuleEnvironmentExtensions.intTypeRef(G);
} else {
_xifexpression = RuleEnvironmentExtensions.numberTypeRef(G);
}
T = _xifexpression;
return new Result<TypeRef>(T);
}
use of org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef in project n4js by eclipse.
the class InternalTypeSystem method upperBoundImpl.
protected Result<TypeRef> upperBoundImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final ParameterizedTypeRef ptr) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeRef> _result_ = applyRuleUpperBoundParameterizedTypeRef(G, _subtrace_, ptr);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("upperBoundParameterizedTypeRef") + stringRepForEnv(G) + " |~ " + stringRep(ptr) + " /\\ " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleUpperBoundParameterizedTypeRef) {
upperBoundThrowException(ruleName("upperBoundParameterizedTypeRef") + stringRepForEnv(G) + " |~ " + stringRep(ptr) + " /\\ " + "TypeRef", UPPERBOUNDPARAMETERIZEDTYPEREF, e_applyRuleUpperBoundParameterizedTypeRef, ptr, new ErrorInformation[] { new ErrorInformation(ptr) });
return null;
}
}
use of org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef in project n4js by eclipse.
the class InternalTypeSystem method _applyRuleTypeCatchVariable_1.
private ParameterizedTypeRef _applyRuleTypeCatchVariable_1(final RuleEnvironment G, final CatchVariable catchVariable) throws RuleFailedException {
ParameterizedTypeRef _xifexpression = null;
boolean _enforceDynamicTypes = this.jsVariantHelper.enforceDynamicTypes(catchVariable);
if (_enforceDynamicTypes) {
_xifexpression = RuleEnvironmentExtensions.anyTypeRefDynamic(G);
} else {
_xifexpression = RuleEnvironmentExtensions.anyTypeRef(G);
}
return _xifexpression;
}
Aggregations