Search in sources :

Example 41 with ParameterizedTypeRef

use of org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef in project n4js by eclipse.

the class WildcardImpl method getDeclaredOrImplicitUpperBound.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public TypeRef getDeclaredOrImplicitUpperBound() {
    final TypeRef declUB = this.getDeclaredUpperBound();
    if ((declUB != null)) {
        return declUB;
    }
    TypeRef _declaredLowerBound = this.getDeclaredLowerBound();
    boolean _tripleNotEquals = (_declaredLowerBound != null);
    if (_tripleNotEquals) {
        return null;
    }
    final EObject parent = this.eContainer();
    if ((parent instanceof ParameterizedTypeRef)) {
        final int typeArgIndex = ((ParameterizedTypeRef) parent).getTypeArgs().indexOf(this);
        if ((typeArgIndex >= 0)) {
            final Object declType = ((ParameterizedTypeRef) parent).eGet(TypeRefsPackage.eINSTANCE.getParameterizedTypeRef_DeclaredType(), false);
            if ((declType instanceof ContainerType<?>)) {
                boolean _eIsProxy = ((ContainerType<?>) declType).eIsProxy();
                boolean _not = (!_eIsProxy);
                if (_not) {
                    final EList<TypeVariable> typeVars = ((ContainerType<?>) declType).getTypeVars();
                    TypeVariable _xifexpression = null;
                    int _size = typeVars.size();
                    boolean _lessThan = (typeArgIndex < _size);
                    if (_lessThan) {
                        _xifexpression = typeVars.get(typeArgIndex);
                    } else {
                        _xifexpression = null;
                    }
                    final TypeVariable typeVar = _xifexpression;
                    if ((typeVar != null)) {
                        final TypeRef implicitUB = typeVar.getDeclaredUpperBound();
                        return implicitUB;
                    }
                }
            }
        }
    }
    return null;
}
Also used : ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) TypeVariable(org.eclipse.n4js.ts.types.TypeVariable) ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) TypeRef(org.eclipse.n4js.ts.typeRefs.TypeRef) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject) ContainerType(org.eclipse.n4js.ts.types.ContainerType) EObject(org.eclipse.emf.ecore.EObject) InternalEObject(org.eclipse.emf.ecore.InternalEObject)

Example 42 with ParameterizedTypeRef

use of org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef in project n4js by eclipse.

the class TClassImpl method basicSetSuperClassRef.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetSuperClassRef(ParameterizedTypeRef newSuperClassRef, NotificationChain msgs) {
    ParameterizedTypeRef oldSuperClassRef = superClassRef;
    superClassRef = newSuperClassRef;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TypesPackage.TCLASS__SUPER_CLASS_REF, oldSuperClassRef, newSuperClassRef);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 43 with ParameterizedTypeRef

use of org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef in project n4js by eclipse.

the class TObjectPrototypeImpl method basicSetSuperType.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public NotificationChain basicSetSuperType(ParameterizedTypeRef newSuperType, NotificationChain msgs) {
    ParameterizedTypeRef oldSuperType = superType;
    superType = newSuperType;
    if (eNotificationRequired()) {
        ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, TypesPackage.TOBJECT_PROTOTYPE__SUPER_TYPE, oldSuperType, newSuperType);
        if (msgs == null)
            msgs = notification;
        else
            msgs.add(notification);
    }
    return msgs;
}
Also used : ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 44 with ParameterizedTypeRef

use of org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef in project n4js by eclipse.

the class TClassImpl method getSuperClassifierRefs.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public Iterable<ParameterizedTypeRef> getSuperClassifierRefs() {
    ParameterizedTypeRef _superClassRef = this.getSuperClassRef();
    boolean _tripleNotEquals = (_superClassRef != null);
    if (_tripleNotEquals) {
        return Iterables.<ParameterizedTypeRef>concat(Collections.<ParameterizedTypeRef>singleton(this.getSuperClassRef()), this.getImplementedInterfaceRefs());
    }
    return Iterables.<ParameterizedTypeRef>concat(this.getImplementedInterfaceRefs());
}
Also used : ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef)

Example 45 with ParameterizedTypeRef

use of org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef in project n4js by eclipse.

the class TClassImpl method getSuperClass.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public TClass getSuperClass() {
    ParameterizedTypeRef _superClassRef = this.getSuperClassRef();
    Type _declaredType = null;
    if (_superClassRef != null) {
        _declaredType = _superClassRef.getDeclaredType();
    }
    final Type superType = _declaredType;
    TClass _xifexpression = null;
    if ((superType instanceof TClass)) {
        _xifexpression = ((TClass) superType);
    } else {
        _xifexpression = null;
    }
    return _xifexpression;
}
Also used : ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) Type(org.eclipse.n4js.ts.types.Type) TClass(org.eclipse.n4js.ts.types.TClass)

Aggregations

ParameterizedTypeRef (org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef)80 TypeTypeRef (org.eclipse.n4js.ts.typeRefs.TypeTypeRef)48 TypeRef (org.eclipse.n4js.ts.typeRefs.TypeRef)47 BoundThisTypeRef (org.eclipse.n4js.ts.typeRefs.BoundThisTypeRef)45 ComposedTypeRef (org.eclipse.n4js.ts.typeRefs.ComposedTypeRef)44 ExistentialTypeRef (org.eclipse.n4js.ts.typeRefs.ExistentialTypeRef)44 StructuralTypeRef (org.eclipse.n4js.ts.typeRefs.StructuralTypeRef)44 BaseTypeRef (org.eclipse.n4js.ts.typeRefs.BaseTypeRef)42 FunctionTypeRef (org.eclipse.n4js.ts.typeRefs.FunctionTypeRef)42 ThisTypeRef (org.eclipse.n4js.ts.typeRefs.ThisTypeRef)42 UnknownTypeRef (org.eclipse.n4js.ts.typeRefs.UnknownTypeRef)42 StaticBaseTypeRef (org.eclipse.n4js.ts.typeRefs.StaticBaseTypeRef)41 RuleFailedException (org.eclipse.xsemantics.runtime.RuleFailedException)32 EObject (org.eclipse.emf.ecore.EObject)30 ErrorInformation (org.eclipse.xsemantics.runtime.ErrorInformation)23 Result (org.eclipse.xsemantics.runtime.Result)23 StructuralTypingResult (org.eclipse.n4js.typesystem.StructuralTypingResult)22 Type (org.eclipse.n4js.ts.types.Type)21 RuleApplicationTrace (org.eclipse.xsemantics.runtime.RuleApplicationTrace)21 ContainerType (org.eclipse.n4js.ts.types.ContainerType)17