use of org.eclipse.xtext.xbase.typesystem.internal.CompoundReentrantTypeResolver in project xtext-xtend by eclipse.
the class Oven method assertExpressionTypeIsResolved.
public void assertExpressionTypeIsResolved(final XExpression expression, final IResolvedTypes types) {
try {
final Object internalTypes = this._reflectExtensions.invoke(types, "delegate");
TypeData _switchResult = null;
boolean _matched = false;
if (internalTypes instanceof CompoundReentrantTypeResolver) {
_matched = true;
TypeData _xblockexpression = null;
{
final Method method = CompoundReentrantTypeResolver.class.getDeclaredMethod("getDelegate", XExpression.class);
method.setAccessible(true);
final Object delegate = method.invoke(internalTypes, expression);
TypeData _xifexpression = null;
if ((delegate instanceof RootResolvedTypes)) {
Object _invoke = this._reflectExtensions.invoke(delegate, "getTypeData", expression, Boolean.FALSE);
_xifexpression = ((TypeData) _invoke);
}
_xblockexpression = _xifexpression;
}
_switchResult = _xblockexpression;
}
if (!_matched) {
Object _invoke = this._reflectExtensions.invoke(internalTypes, "getTypeData", expression, Boolean.FALSE);
_switchResult = ((TypeData) _invoke);
}
final TypeData type = _switchResult;
String _string = expression.toString();
String _plus = ("Type is not resolved. Expression: " + _string);
boolean _xifexpression = false;
if ((expression instanceof XAbstractFeatureCall)) {
_xifexpression = (((XAbstractFeatureCall) expression).isPackageFragment() || (type != null));
} else {
_xifexpression = (type != null);
}
Assert.assertTrue(_plus, _xifexpression);
} catch (Throwable _e) {
throw Exceptions.sneakyThrow(_e);
}
}
Aggregations