use of org.eclipse.xsemantics.runtime.ErrorInformation in project n4js by eclipse.
the class InternalTypeSystem method typeImpl.
protected Result<TypeRef> typeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final UnaryExpression e) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeRef> _result_ = applyRuleTypeUnaryExpression(G, _subtrace_, e);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("typeUnaryExpression") + stringRepForEnv(G) + " |- " + stringRep(e) + " : " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleTypeUnaryExpression) {
typeThrowException(ruleName("typeUnaryExpression") + stringRepForEnv(G) + " |- " + stringRep(e) + " : " + "TypeRef", TYPEUNARYEXPRESSION, e_applyRuleTypeUnaryExpression, e, new ErrorInformation[] { new ErrorInformation(e) });
return null;
}
}
use of org.eclipse.xsemantics.runtime.ErrorInformation in project n4js by eclipse.
the class InternalTypeSystem method applyRuleSubtypeBoundThisTypeRef.
protected Result<Boolean> applyRuleSubtypeBoundThisTypeRef(final RuleEnvironment G, final RuleApplicationTrace _trace_, final BoundThisTypeRef left, final BoundThisTypeRef right) throws RuleFailedException {
boolean _isUseSiteStructuralTyping = right.isUseSiteStructuralTyping();
if (_isUseSiteStructuralTyping) {
final StructuralTypingResult result = this.typeSystemHelper.isStructuralSubtype(G, left, right);
boolean _isValue = result.isValue();
boolean _not = (!_isValue);
if (_not) {
/* fail error result.message data PRIORITY_ERROR */
String _message = result.getMessage();
String error = _message;
Object data = TypeSystemErrorExtensions.PRIORITY_ERROR;
throwForExplicitFail(error, new ErrorInformation(null, null, data));
}
} else {
boolean _isUseSiteStructuralTyping_1 = left.isUseSiteStructuralTyping();
boolean _isUseSiteStructuralTyping_2 = right.isUseSiteStructuralTyping();
boolean _tripleEquals = (Boolean.valueOf(_isUseSiteStructuralTyping_1) == Boolean.valueOf(_isUseSiteStructuralTyping_2));
/* left.useSiteStructuralTyping === right.useSiteStructuralTyping */
if (!_tripleEquals) {
sneakyThrowRuleFailedException("left.useSiteStructuralTyping === right.useSiteStructuralTyping");
}
/* G |- left.actualThisTypeRef <: right.actualThisTypeRef */
ParameterizedTypeRef _actualThisTypeRef = left.getActualThisTypeRef();
ParameterizedTypeRef _actualThisTypeRef_1 = right.getActualThisTypeRef();
subtypeInternal(G, _trace_, _actualThisTypeRef, _actualThisTypeRef_1);
}
return new Result<Boolean>(true);
}
use of org.eclipse.xsemantics.runtime.ErrorInformation in project n4js by eclipse.
the class InternalTypeSystem method typeImpl.
protected Result<TypeRef> typeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final IndexedAccessExpression expr) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeRef> _result_ = applyRuleTypeIndexedAccessExpression(G, _subtrace_, expr);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("typeIndexedAccessExpression") + stringRepForEnv(G) + " |- " + stringRep(expr) + " : " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleTypeIndexedAccessExpression) {
typeThrowException(ruleName("typeIndexedAccessExpression") + stringRepForEnv(G) + " |- " + stringRep(expr) + " : " + "TypeRef", TYPEINDEXEDACCESSEXPRESSION, e_applyRuleTypeIndexedAccessExpression, expr, new ErrorInformation[] { new ErrorInformation(expr) });
return null;
}
}
use of org.eclipse.xsemantics.runtime.ErrorInformation in project n4js by eclipse.
the class InternalTypeSystem method typeImpl.
protected Result<TypeRef> typeImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final PromisifyExpression e) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeRef> _result_ = applyRuleTypePromisifyExpression(G, _subtrace_, e);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("typePromisifyExpression") + stringRepForEnv(G) + " |- " + stringRep(e) + " : " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleTypePromisifyExpression) {
typeThrowException(ruleName("typePromisifyExpression") + stringRepForEnv(G) + " |- " + stringRep(e) + " : " + "TypeRef", TYPEPROMISIFYEXPRESSION, e_applyRuleTypePromisifyExpression, e, new ErrorInformation[] { new ErrorInformation(e) });
return null;
}
}
use of org.eclipse.xsemantics.runtime.ErrorInformation in project n4js by eclipse.
the class InternalTypeSystem method expectedTypeInImpl.
protected Result<TypeRef> expectedTypeInImpl(final RuleEnvironment G, final RuleApplicationTrace _trace_, final Argument argument, final Expression argumentExpression) throws RuleFailedException {
try {
final RuleApplicationTrace _subtrace_ = newTrace(_trace_);
final Result<TypeRef> _result_ = applyRuleExpectedTypeOfArgument(G, _subtrace_, argument, argumentExpression);
addToTrace(_trace_, new Provider<Object>() {
public Object get() {
return ruleName("expectedTypeOfArgument") + stringRepForEnv(G) + " |- " + stringRep(argument) + " |> " + stringRep(argumentExpression) + " : " + stringRep(_result_.getFirst());
}
});
addAsSubtrace(_trace_, _subtrace_);
return _result_;
} catch (Exception e_applyRuleExpectedTypeOfArgument) {
expectedTypeInThrowException(ruleName("expectedTypeOfArgument") + stringRepForEnv(G) + " |- " + stringRep(argument) + " |> " + stringRep(argumentExpression) + " : " + "TypeRef", EXPECTEDTYPEOFARGUMENT, e_applyRuleExpectedTypeOfArgument, argument, argumentExpression, new ErrorInformation[] { new ErrorInformation(argument), new ErrorInformation(argumentExpression) });
return null;
}
}
Aggregations