diff --git a/src/dev/flang/ast/AstErrors.java b/src/dev/flang/ast/AstErrors.java index 5e0f735509..06396e2627 100644 --- a/src/dev/flang/ast/AstErrors.java +++ b/src/dev/flang/ast/AstErrors.java @@ -424,7 +424,12 @@ else if (frmlT.compareTo(Types.resolved.t_unit) == 0) } else { - remedy = "To solve this, you could change the type of the target " + ss(target) + " to " + s(actlT) + " or convert the type of the assigned value to " + s(frmlT) + ".\n"; + remedy = !frmlT.isRef() && !actlT.isGenericArgument() && !frmlT.isGenericArgument() && actlT.feature().inheritsFrom(frmlT.feature()) ? + "To solve this you could:\n" + // + " • make " + s(frmlT) + " a reference by adding the " + st("ref")+ " keyword, so all its heirs can be used in place of it,\n" + // + " • change the type of the target " + ss(target) + " to " + s(actlT) + ", or\n" + // + " • convert the type of the assigned value to " + s(frmlT) + "." + : "To solve this, you could change the type of the target " + ss(target) + " to " + s(actlT) + " or convert the type of the assigned value to " + s(frmlT) + ".\n"; } actlFound = "actual type found : " + s(actlT); valAssigned = "for value assigned : " + s(value) + "\n";