me = ((Tree.ParameterizedExpression) me).getPrimary();
}
assign(me);
Tree.SpecifierExpression sie = that.getSpecifierExpression();
if (me instanceof Tree.BaseMemberExpression) {
Declaration d = that.getDeclaration();
if (d instanceof TypedDeclaration) {
if (that.getRefinement()) {
// interpret this specification as a
// refinement of an inherited member
if (d instanceof Value) {
refineValue(that);
}
else if (d instanceof Method) {
refineMethod(that);
}
Tree.BaseMemberExpression bme =
(Tree.BaseMemberExpression) me;
bme.setDeclaration(that.getDeclaration());
}
else if (d instanceof MethodOrValue) {
MethodOrValue mv = (MethodOrValue) d;
if (mv.isShortcutRefinement()) {
String desc;
if (d instanceof Value) {
desc = "value";
}
else {
desc = "function";
}
me.addError(desc + " already specified: '" +
d.getName(unit) + "'");
}
else if (!mv.isVariable() && !mv.isLate()) {
String desc;
if (d instanceof Value) {
desc = "value is neither variable nor late and";
}
else {
desc = "function";
}
if (mv.isToplevel()) {
me.addError("toplevel " + desc +
" may not be specified: '" +
d.getName(unit) + "'", 803);
}
else if (!mv.isDefinedInScope(that.getScope())) {
me.addError(desc + " may not be specified here: '" +
d.getName(unit) + "'", 803);
}
}
}
if (hasParams && d instanceof Method &&
((Method) d).isDeclaredVoid() &&
!isSatementExpression(sie.getExpression())) {
sie.addError("function is declared void so specified expression must be a statement: '" +
d.getName(unit) + "' is declared 'void'");
}
if (d instanceof Value &&
sie instanceof Tree.LazySpecifierExpression) {
((Value) d).setTransient(true);
}
ProducedType t = that.getBaseMemberExpression().getTypeModel();
if (that.getBaseMemberExpression()==me && d instanceof Method) {
//if the declaration of the method has
//defaulted parameters, we should ignore
//that when determining if the RHS is
//an acceptable implementation of the
//method
//TODO: this is a pretty nasty way to
// handle the problem
t = eraseDefaultedParameters(t);
}
if (!isTypeUnknown(t)) {
checkType(t, d.getName(unit), sie, 2100);
}
}
if (that.getBaseMemberExpression() instanceof Tree.ParameterizedExpression) {
if (!(sie instanceof Tree.LazySpecifierExpression)) {
sie.addError("functions with parameters must be specified using =>");