use of org.eclipse.n4js.ts.typeRefs.StaticBaseTypeRef in project n4js by eclipse.
the class InternalTypeSystem method applyRuleExpectedTypeInUnaryExpression.
protected Result<TypeRef> applyRuleExpectedTypeInUnaryExpression(final RuleEnvironment G, final RuleApplicationTrace _trace_, final UnaryExpression e, final Expression expression) throws RuleFailedException {
// output parameter
TypeRef T = null;
StaticBaseTypeRef _xifexpression = null;
boolean _isTypeAware = this.jsVariantHelper.isTypeAware(e);
if (_isTypeAware) {
StaticBaseTypeRef _switchResult = null;
UnaryOperator _op = e.getOp();
if (_op != null) {
switch(_op) {
case DELETE:
_switchResult = TypeUtils.createNonSimplifiedUnionType(RuleEnvironmentExtensions.anyTypeRef(G), RuleEnvironmentExtensions.voidTypeRef(G));
break;
case VOID:
_switchResult = TypeUtils.createNonSimplifiedUnionType(RuleEnvironmentExtensions.anyTypeRef(G), RuleEnvironmentExtensions.voidTypeRef(G));
break;
case TYPEOF:
_switchResult = TypeUtils.createNonSimplifiedUnionType(RuleEnvironmentExtensions.anyTypeRef(G), RuleEnvironmentExtensions.voidTypeRef(G));
break;
case INC:
_switchResult = RuleEnvironmentExtensions.numberTypeRef(G);
break;
case DEC:
_switchResult = RuleEnvironmentExtensions.numberTypeRef(G);
break;
case POS:
_switchResult = RuleEnvironmentExtensions.numberTypeRef(G);
break;
case NEG:
_switchResult = RuleEnvironmentExtensions.numberTypeRef(G);
break;
case INV:
_switchResult = RuleEnvironmentExtensions.numberTypeRef(G);
break;
case NOT:
_switchResult = RuleEnvironmentExtensions.anyTypeRef(G);
break;
default:
_switchResult = RuleEnvironmentExtensions.anyTypeRef(G);
break;
}
} else {
_switchResult = RuleEnvironmentExtensions.anyTypeRef(G);
}
_xifexpression = _switchResult;
} else {
StaticBaseTypeRef _switchResult_1 = null;
UnaryOperator _op_1 = e.getOp();
if (_op_1 != null) {
switch(_op_1) {
case DELETE:
_switchResult_1 = TypeUtils.createNonSimplifiedUnionType(RuleEnvironmentExtensions.anyTypeRef(G), RuleEnvironmentExtensions.voidTypeRef(G));
break;
case VOID:
_switchResult_1 = TypeUtils.createNonSimplifiedUnionType(RuleEnvironmentExtensions.anyTypeRef(G), RuleEnvironmentExtensions.voidTypeRef(G));
break;
case TYPEOF:
_switchResult_1 = TypeUtils.createNonSimplifiedUnionType(RuleEnvironmentExtensions.anyTypeRef(G), RuleEnvironmentExtensions.voidTypeRef(G));
break;
default:
_switchResult_1 = RuleEnvironmentExtensions.anyTypeRef(G);
break;
}
} else {
_switchResult_1 = RuleEnvironmentExtensions.anyTypeRef(G);
}
_xifexpression = _switchResult_1;
}
T = _xifexpression;
return new Result<TypeRef>(T);
}
Aggregations