Commit Graph

3 Commits

Author SHA1 Message Date
Mark Brown
8f05cd84a1 Update test results. 2015-12-02 23:09:03 +11:00
Mark Brown
ecfe659940 Revert the workaround from commit 3c255eea
Bug 264, which this workaround was for, has been fixed in other changes.

compiler/mode_errors.m:
    Remove the temporary error.

compiler/modecheck_unify.m:
    Don't check this error condition.

doc/reference_manual.texi:
    Document the constraint that actually applies, namely that functions
    that do not match the default mode do not match Mercury's 'ground'
    inst.

    Clarify that "no higher-order inst information" means no *explicit*
    information. Given that there is a default, this is not the same as
    saying there are no logical consequences.

tests/invalid/default_ho_inst.err_exp:
tests/invalid/default_ho_inst_2.err_exp:
    Update expected output.

tests/valid/Mmakefile:
tests/valid/ho_func_call_2.m:
    New test case. Function modes that are not the same as the default,
    but that match it, can still safely be treated as ground.
2015-12-02 21:00:13 +11:00
Zoltan Somogyi
3c255eeac7 Don't allow putting functions with nondefault signatures into terms.
The code that takes the function out of the term can use the function
as if it had the default signature. If it doesn't, this can lead to
This fixes Mantis bug 264.

compiler/mode_errors.m:
    Provide a way to record such errors, and to print error messages for them.

compiler/modecheck_unify.m:
    Look for such errors when constructing terms.

browser/declarative_user.m:
    Don't put a function with a nondefault signature (it used a subtype)
    into a term. Enforce the subtype with a runtime assertion instead.

doc/reference_manual.texi:
    Document the new limitation.

tests/invalid/default_ho_inst.{m,err_exp}:
    The test case for Mantis bug 264.

tests/invalid/Mmakefile:
    Enable the new test case.

tests/valid/Mmakefile:
    Disable the old ho_func_call test case, since it RELIES on putting
    functions with nondefault modes into terms. It also uses I/O states
    in ui modes.
2015-11-02 13:09:37 +11:00