Search in sources :

Example 1 with InferredTypeReferenceImpl

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;
}
Also used : InferredTypeReferenceImpl(org.eclipse.xtend.core.macro.declaration.InferredTypeReferenceImpl) TypeReferenceImpl(org.eclipse.xtend.core.macro.declaration.TypeReferenceImpl) InferredTypeReferenceImpl(org.eclipse.xtend.core.macro.declaration.InferredTypeReferenceImpl) JvmTypeReference(org.eclipse.xtext.common.types.JvmTypeReference)

Example 2 with InferredTypeReferenceImpl

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;
}
Also used : InferredTypeReferenceImpl(org.eclipse.xtend.core.macro.declaration.InferredTypeReferenceImpl) XComputedTypeReferenceImplCustom(org.eclipse.xtext.xtype.impl.XComputedTypeReferenceImplCustom) Procedure1(org.eclipse.xtext.xbase.lib.Procedures.Procedure1) LightweightTypeReference(org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference) TypeReference(org.eclipse.xtend.lib.macro.declaration.TypeReference) JvmTypeReference(org.eclipse.xtext.common.types.JvmTypeReference)

Example 3 with InferredTypeReferenceImpl

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;
}
Also used : InferredTypeReferenceImpl(org.eclipse.xtend.core.macro.declaration.InferredTypeReferenceImpl) LightweightTypeReference(org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference) TypeReferenceImpl(org.eclipse.xtend.core.macro.declaration.TypeReferenceImpl) InferredTypeReferenceImpl(org.eclipse.xtend.core.macro.declaration.InferredTypeReferenceImpl)

Aggregations

InferredTypeReferenceImpl (org.eclipse.xtend.core.macro.declaration.InferredTypeReferenceImpl)3 TypeReferenceImpl (org.eclipse.xtend.core.macro.declaration.TypeReferenceImpl)2 JvmTypeReference (org.eclipse.xtext.common.types.JvmTypeReference)2 LightweightTypeReference (org.eclipse.xtext.xbase.typesystem.references.LightweightTypeReference)2 TypeReference (org.eclipse.xtend.lib.macro.declaration.TypeReference)1 Procedure1 (org.eclipse.xtext.xbase.lib.Procedures.Procedure1)1 XComputedTypeReferenceImplCustom (org.eclipse.xtext.xtype.impl.XComputedTypeReferenceImplCustom)1