Search in sources :

Example 56 with Type

use of org.eclipse.n4js.ts.types.Type in project n4js by eclipse.

the class PropertyMethodDeclarationImpl method setDefinedType.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setDefinedType(Type newDefinedType) {
    Type oldDefinedType = definedType;
    definedType = newDefinedType;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, N4JSPackage.PROPERTY_METHOD_DECLARATION__DEFINED_TYPE, oldDefinedType, definedType));
}
Also used : Type(org.eclipse.n4js.ts.types.Type) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 57 with Type

use of org.eclipse.n4js.ts.types.Type in project n4js by eclipse.

the class N4MethodDeclarationImpl method getDefinedFunction.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public TFunction getDefinedFunction() {
    final Type defType = this.getDefinedType();
    TFunction _xifexpression = null;
    if ((defType instanceof TFunction)) {
        _xifexpression = ((TFunction) defType);
    }
    return _xifexpression;
}
Also used : Type(org.eclipse.n4js.ts.types.Type) TFunction(org.eclipse.n4js.ts.types.TFunction)

Example 58 with Type

use of org.eclipse.n4js.ts.types.Type in project n4js by eclipse.

the class N4MethodDeclarationImpl method getDefinedTypeElement.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public TMember getDefinedTypeElement() {
    TMember _xifexpression = null;
    Type _definedType = this.getDefinedType();
    boolean _tripleEquals = (_definedType == null);
    if (_tripleEquals) {
        _xifexpression = null;
    } else {
        TMember _xifexpression_1 = null;
        Type _definedType_1 = this.getDefinedType();
        if ((_definedType_1 instanceof TMember)) {
            Type _definedType_2 = this.getDefinedType();
            _xifexpression_1 = ((TMember) _definedType_2);
        } else {
            throw new IllegalArgumentException("");
        }
        _xifexpression = _xifexpression_1;
    }
    return _xifexpression;
}
Also used : Type(org.eclipse.n4js.ts.types.Type) TMember(org.eclipse.n4js.ts.types.TMember)

Example 59 with Type

use of org.eclipse.n4js.ts.types.Type in project n4js by eclipse.

the class TypeDefiningElementImpl method setDefinedType.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setDefinedType(Type newDefinedType) {
    Type oldDefinedType = definedType;
    definedType = newDefinedType;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, N4JSPackage.TYPE_DEFINING_ELEMENT__DEFINED_TYPE, oldDefinedType, definedType));
}
Also used : Type(org.eclipse.n4js.ts.types.Type) ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl)

Example 60 with Type

use of org.eclipse.n4js.ts.types.Type in project n4js by eclipse.

the class N4JSASTUtils method getOwnOrSuperCtor.

private static TMember getOwnOrSuperCtor(final ContainerType<?> ownerOfField) {
    TClass klass = (TClass) (ownerOfField instanceof TClass ? ownerOfField : null);
    while (null != klass) {
        final TMember ctor = klass.findOwnedMember(CONSTRUCTOR);
        if (null != ctor) {
            return ctor;
        }
        final ParameterizedTypeRef superClassRef = klass.getSuperClassRef();
        if (null == superClassRef) {
            klass = null;
        } else {
            final Type declaredType = superClassRef.getDeclaredType();
            klass = (TClass) (declaredType instanceof TClass ? declaredType : null);
        }
    }
    return null;
}
Also used : ParameterizedTypeRef(org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef) ContainerType(org.eclipse.n4js.ts.types.ContainerType) Type(org.eclipse.n4js.ts.types.Type) TMember(org.eclipse.n4js.ts.types.TMember) TClass(org.eclipse.n4js.ts.types.TClass)

Aggregations

Type (org.eclipse.n4js.ts.types.Type)84 ContainerType (org.eclipse.n4js.ts.types.ContainerType)32 ParameterizedTypeRef (org.eclipse.n4js.ts.typeRefs.ParameterizedTypeRef)28 TStructuralType (org.eclipse.n4js.ts.types.TStructuralType)26 EObject (org.eclipse.emf.ecore.EObject)21 TypeRef (org.eclipse.n4js.ts.typeRefs.TypeRef)21 PrimitiveType (org.eclipse.n4js.ts.types.PrimitiveType)19 AnyType (org.eclipse.n4js.ts.types.AnyType)18 UndefinedType (org.eclipse.n4js.ts.types.UndefinedType)18 TypeTypeRef (org.eclipse.n4js.ts.typeRefs.TypeTypeRef)17 NullType (org.eclipse.n4js.ts.types.NullType)17 VoidType (org.eclipse.n4js.ts.types.VoidType)17 ComposedTypeRef (org.eclipse.n4js.ts.typeRefs.ComposedTypeRef)16 ExistentialTypeRef (org.eclipse.n4js.ts.typeRefs.ExistentialTypeRef)16 ThisTypeRef (org.eclipse.n4js.ts.typeRefs.ThisTypeRef)16 UnknownTypeRef (org.eclipse.n4js.ts.typeRefs.UnknownTypeRef)16 ModuleNamespaceVirtualType (org.eclipse.n4js.ts.types.ModuleNamespaceVirtualType)16 StructuralTypingResult (org.eclipse.n4js.typesystem.StructuralTypingResult)16 Result (org.eclipse.xsemantics.runtime.Result)16 BaseTypeRef (org.eclipse.n4js.ts.typeRefs.BaseTypeRef)15