use of org.eclipse.xtend.core.macro.declaration.InferredTypeReferenceImpl in project xtext-xtend by eclipse.
the class CompilationUnitImpl method toJvmTypeReference.
public JvmTypeReference toJvmTypeReference(final TypeReference typeRef) {
this.checkCanceled();
JvmTypeReference _switchResult = null;
boolean _matched = false;
if (typeRef instanceof TypeReferenceImpl) {
_matched = true;
_switchResult = ((TypeReferenceImpl) typeRef).getLightweightTypeReference().toJavaCompliantTypeReference();
}
if (!_matched) {
if (typeRef instanceof InferredTypeReferenceImpl) {
_matched = true;
_switchResult = EcoreUtil.<XComputedTypeReferenceImplCustom>copy(((InferredTypeReferenceImpl) typeRef).getDelegate());
}
}
return _switchResult;
}
use of org.eclipse.xtend.core.macro.declaration.InferredTypeReferenceImpl in project xtext-xtend by eclipse.
the class CompilationUnitImpl method toTypeReference.
public TypeReference toTypeReference(final JvmTypeReference delegate) {
TypeReference _xblockexpression = null;
{
if ((delegate == null)) {
return null;
}
TypeReference _switchResult = null;
boolean _matched = false;
if (delegate instanceof XComputedTypeReferenceImplCustom) {
boolean _isEquivalentComputed = ((XComputedTypeReferenceImplCustom) delegate).isEquivalentComputed();
boolean _not = (!_isEquivalentComputed);
if (_not) {
_matched = true;
InferredTypeReferenceImpl _inferredTypeReferenceImpl = new InferredTypeReferenceImpl();
final Procedure1<InferredTypeReferenceImpl> _function = (InferredTypeReferenceImpl it) -> {
it.setDelegate(((XComputedTypeReferenceImplCustom) delegate));
it.setCompilationUnit(this);
};
_switchResult = ObjectExtensions.<InferredTypeReferenceImpl>operator_doubleArrow(_inferredTypeReferenceImpl, _function);
}
}
if (!_matched) {
_switchResult = this.toTypeReference(this.typeRefFactory.toLightweightReference(delegate), delegate);
}
_xblockexpression = _switchResult;
}
return _xblockexpression;
}
use of org.eclipse.xtend.core.macro.declaration.InferredTypeReferenceImpl in project xtext-xtend by eclipse.
the class CompilationUnitImpl method toLightweightTypeReference.
public LightweightTypeReference toLightweightTypeReference(final TypeReference typeRef) {
this.checkCanceled();
LightweightTypeReference _switchResult = null;
boolean _matched = false;
if (typeRef instanceof TypeReferenceImpl) {
_matched = true;
_switchResult = ((TypeReferenceImpl) typeRef).getLightweightTypeReference();
}
if (!_matched) {
if (typeRef instanceof InferredTypeReferenceImpl) {
_matched = true;
_switchResult = ((InferredTypeReferenceImpl) typeRef).getLightweightTypeReference();
}
}
return _switchResult;
}
Aggregations