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);
}