optionalType.setUnderlyingType(type.getUnderlyingType());
type = optionalType;
}
}
MethodOrValue value = null;
if (isCeylon && decl instanceof Class){
// For a functional parameter to a class, we can just lookup the member
value = (MethodOrValue)((Class)decl).getDirectMember(paramName, null, false);
}
if (value == null) {
// So either decl is not a Class,
// or the method or value member of decl is not shared
AnnotationMirror functionalParameterAnnotation = paramMirror.getAnnotation(CEYLON_FUNCTIONAL_PARAMETER_ANNOTATION);
if (functionalParameterAnnotation != null) {
// A functional parameter to a method
Method method = loadFunctionalParameter((Declaration)decl, paramName, type, (String)functionalParameterAnnotation.getValue());
value = method;
parameter.setDeclaredAnything(method.isDeclaredVoid());
} else {
// A value parameter to a method
value = new Value();
value.setType(type);
}
value.setContainer((Scope) decl);
value.setScope((Scope) decl);
DeclarationVisitor.setVisibleScope(value);
value.setUnit(((Element)decl).getUnit());
value.setName(paramName);
}
value.setInitializerParameter(parameter);
parameter.setModel(value);
if(paramMirror.getAnnotation(CEYLON_SEQUENCED_ANNOTATION) != null
|| isVariadic)
parameter.setSequenced(true);