Files
mercury/tests/invalid/exist_foreign_error.err_exp
Zoltan Somogyi 291879c8bb Move checks for type_infos to add_foreign_proc.m.
This allows to perform those checks for *all* foreign_procs,
not just the ones that get added to the HLDS.

compiler/add_foreign_proc.m:
    Move the code that checks the bodies of foreign_procs for the
    presence of type_info variables for existentially quantified
    type variables here from typecheck.m and typecheck_errors.m.
    Change the diagnostic's wording to match our new phraseology.

    Record identifiers in a set, not a list, for faster membership tests,
    since we now do even more of them.

compiler/foreign.m:
    Provide a mechanism to return the identifiers not just in the
    non-comment parts of foreign_procs, but the comment parts as well,
    since add_foreign_proc.m now needs this functionality.

compiler/make_hlds_warn.m:
    Conform to the change in foreign.m.

compiler/typecheck.m:
compiler/typecheck_errors.m:
    Delete the code that was moved (in a modified form)
    to add_foreign_proc.m.

compiler/ml_foreign_proc_gen.m:
    Update a reference in a comment.

tests/invalid/exist_foreign_error.err_exp:
    Expect the updated wording of the affected diagnostics,
    and expect diagnostics for *all* the foreign_procs in the test,
    regardless of which language they are for.

tests/invalid/exist_foreign_error.err_exp2:
tests/invalid/exist_foreign_error.err_exp3:
    Delete these files, since the output they expect is now
    in the .err_exp file.

tests/invalid/fp_dup_bug.err_exp2:
tests/invalid/fp_dup_bug.err_exp3:
tests/invalid/gh72_errors.err_exp2:
tests/invalid/gh72_errors.err_exp3:
    Expect the updated wording of diagnostics affected by previous
    changes (which updated the .err_exp files for C, not these for
    Java and C#).
2026-01-31 16:31:04 +11:00

739 B

exist_foreign_error.m:017: Error: the code of the C foreign_proc for function
exist_foreign_error.m:017: `get_pti_from_arg_types'/2 should define the
exist_foreign_error.m:017: variable `TypeInfo_for_T'.
exist_foreign_error.m:024: Error: the code of the Java foreign_proc for
exist_foreign_error.m:024: function `get_pti_from_arg_types'/2 should define
exist_foreign_error.m:024: the variable `TypeInfo_for_T'.
exist_foreign_error.m:031: Error: the code of the C# foreign_proc for function
exist_foreign_error.m:031: `get_pti_from_arg_types'/2 should define the
exist_foreign_error.m:031: variable `TypeInfo_for_T'.