v.setName(p.getName());
vp.setDeclaration(m);
v.setContainer(m);
v.setScope(m);
l.getParameters().add(vp);
v.setType(new LazyProducedType(that.getUnit()) {
@Override
public Map<TypeParameter, ProducedType> initTypeArguments() {
return rm.getTypedParameter(p).getFullType()
.getTypeArguments();
}
@Override
public TypeDeclaration initDeclaration() {
return rm.getTypedParameter(p).getFullType()
.getDeclaration();
}
});
}
else {
Tree.Parameter tp = tpl.getParameters().get(j);
Parameter rp = tp.getParameterModel();
rp.setDefaulted(p.isDefaulted());
rp.setDeclaration(m);
l.getParameters().add(rp);
}
j++;
}
m.getParameterLists().add(l);
}
if (!sm.getTypeParameters().isEmpty()) {
bme.addError("method has type parameters: " +
message(sm));
}
m.setShared(true);
m.setActual(true);
m.getAnnotations().add(new Annotation("shared"));
m.getAnnotations().add(new Annotation("actual"));
m.setRefinedDeclaration(sm.getRefinedDeclaration()); //Note: this is not the real root, so we set it again in ExpressionVisitor
m.setUnit(that.getUnit());
m.setContainer(c);
m.setShortcutRefinement(true);
m.setDeclaredVoid(sm.isDeclaredVoid());
setVisibleScope(m);
c.addMember(m);
that.setRefinement(true);
that.setDeclaration(m);
that.setRefined(sm);
that.getUnit().addDeclaration(m);
if (that.getScope() instanceof Specification){
((Specification) that.getScope()).setDeclaration(m);
}
m.setType(new LazyProducedType(that.getUnit()) {
@Override
public Map<TypeParameter, ProducedType> initTypeArguments() {
return rm.getType().getTypeArguments();
}
@Override