use of com.redhat.ceylon.model.typechecker.model.Specification in project ceylon-compiler by ceylon.
the class CodegenUtil method isContainerFunctionalParameter.
public static boolean isContainerFunctionalParameter(Declaration declaration) {
Scope containerScope = declaration.getContainer();
Declaration containerDeclaration;
if (containerScope instanceof Specification) {
containerDeclaration = ((Specification) containerScope).getDeclaration();
} else if (containerScope instanceof Declaration) {
containerDeclaration = (Declaration) containerScope;
} else {
throw BugException.unhandledCase(containerScope);
}
return containerDeclaration instanceof Function && ((Function) containerDeclaration).isParameter();
}
Aggregations