Commit Graph

1 Commits

Author SHA1 Message Date
Zoltan Somogyi
4bf9b33481 Warn about the need to import intN/uintN modules.
compiler/typecheck_errors.m:
    When we are reporting a type error in a var-functor unification
    where the functor is the name of a function defined in library/int.m,
    such as A = B - C or D = E + F, check whether

    (a) the types of any of the variables involved in the error, *and*
    (b) the expected argument or result types involved

    are builtin integer types whose modules have NOT been imported.
    If so, then add a note to the error message that points out
    that operations on these type(s) require importing the corresponding
    modules.

    Do the same when reporting type errors in calls to predicates
    whose name is the name of a predicate defined in library/int.m.

    Fix an old ZZZ.

compiler/type_assign.m:
    Fix typo in a (so far unused) field name.

tests/invalid/arith_wrong_module.{m,err_exp}:
    A new test case with three errors, which respectively test the changes
    to the three error-message-generating predicates modified by this diff.

tests/invalid/Mmakefile:
    Enable the new test case.
2022-11-25 03:18:29 +11:00