Search in sources :

Example 1 with Member

use of ceylon.language.meta.model.Member in project ceylon by eclipse.

the class ClassOrInterfaceDeclarationImpl method getAppliedClassOrInterface.

@SuppressWarnings("unchecked")
public <Container, Kind extends ceylon.language.meta.model.ClassOrInterface<? extends Object>> ceylon.language.meta.model.Member<Container, Kind> getAppliedClassOrInterface(@Ignore TypeDescriptor $reifiedContainer, @Ignore TypeDescriptor $reifiedKind, Sequential<? extends ceylon.language.meta.model.Type<?>> types, ceylon.language.meta.model.Type<? extends Object> container) {
    List<org.eclipse.ceylon.model.typechecker.model.Type> producedTypes = Metamodel.getProducedTypes(types);
    Type qualifyingType = Metamodel.getModel(container);
    if (getStatic()) {
        producedTypes.addAll(0, qualifyingType.getTypeArgumentList());
    }
    Metamodel.checkQualifyingType(qualifyingType, declaration);
    Metamodel.checkTypeArguments(qualifyingType, declaration, producedTypes);
    // find the proper qualifying type
    Type memberQualifyingType = qualifyingType.getSupertype((TypeDeclaration) declaration.getContainer());
    Reference producedReference = declaration.appliedReference(memberQualifyingType, producedTypes);
    final Type appliedType = producedReference.getType();
    return (Member<Container, Kind>) Metamodel.getAppliedMetamodel(appliedType);
}
Also used : Type(org.eclipse.ceylon.model.typechecker.model.Type) OpenType(ceylon.language.meta.declaration.OpenType) Reference(org.eclipse.ceylon.model.typechecker.model.Reference) Member(ceylon.language.meta.model.Member)

Aggregations

OpenType (ceylon.language.meta.declaration.OpenType)1 Member (ceylon.language.meta.model.Member)1 Reference (org.eclipse.ceylon.model.typechecker.model.Reference)1 Type (org.eclipse.ceylon.model.typechecker.model.Type)1