Files
mercury/tests/invalid_submodules/unresolved_overloading.err_exp
Zoltan Somogyi 3e2cde2c33 Don't abort compilation for unresolved overloading.
compiler/pred_table.m:
    When we find more than one match for a predicate or function signature,
    we used to generate an error message, print it, and then abort
    compilation. Fix this by returning the error message to be handled
    by our callers.

    The compiler now has to pick one of the matches to continue with.
    The compiler's pick (the first match) may not be the match intended
    by the programmer, and it is possible that the compiler will later generate
    some error messages that would not happen if we picked the match
    intended by the programmer. We therefore warn the programmer about
    this possibility.

compiler/purity.m:
compiler/resolve_unify_functor.m:
    Include the error messages now returned by pred_table.m among
    all the other error messages generated by the purity pass,
    which, amongst other things, does the last part of the job
    of the typechecker.

compiler/intermod.m:
    Ignore the errors caused by unresolved overloading when generating
    .opt files. They will be reported when the compiler tries to generate
    target language code.

library/list.m:
    Add three related utility predicates that we discussed earlier,
    each of which was needed by one version or another of the code
    for constructing the error message in pred_table.m.

NEWS:
    Announce the additions to list.m.

tests/invalid_submodules/unresolved_overloading.{m,err_exp}:
    Expect the updated error message, and the *absence* of a compiler abort.
2022-08-21 15:28:55 +10:00

15 lines
929 B
Plaintext

unresolved_overloading.m:026: Error: unresolved predicate overloading.
unresolved_overloading.m:026: The matches are
unresolved_overloading.m:026: predicate
unresolved_overloading.m:026: `unresolved_overloading.sub.loud_and_annoying'/3,
unresolved_overloading.m:026: and
unresolved_overloading.m:026: predicate
unresolved_overloading.m:026: `unresolved_overloading.loud_and_annoying'/3.
unresolved_overloading.m:026: You need to use an explicit module qualifier to
unresolved_overloading.m:026: select the one you intend to refer to.
unresolved_overloading.m:026: Proceeding on the assumption that the intended
unresolved_overloading.m:026: match is the first. If this assumption is
unresolved_overloading.m:026: incorrect, other error messages may be reported
unresolved_overloading.m:026: for this predicate or function solely because
unresolved_overloading.m:026: of this wrong assumption.