mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-27 23:34:52 +00:00
Estimated hours taken: 4 Confirm, and fix an XXX in polymorphism. univ_to_type couldn't check the arguments of higher order types correctly, so one could circumvent the run-time type check. compiler/polymorphism.m: compiler/base_type_layout.m: Add the real arity into type_info (and pseudo-type-infos) for higher order preds. Also, document recent changes to the structure of type_infos, fix a typo, and remove the XXX. library/std_util.m: Fix the implementation of mercury_compare_type_info so that the arity and argument type_infos of higher-order types are checked. runtime/deep_copy.c: Update offset of the arguments of higher-order type_infos as they have been shifted along one. runtime/type_info.h: Add new #defines for the offset of the arity and arguments for higher order types, to avoid magic numbers in future. tests/hard_coded/Mmake: tests/hard_coded/.cvsignore: tests/hard_coded/ho_univ_to_type.m: tests/hard_coded/ho_univ_to_type.exp: Test case for conversions - tries to do an illegal conversion. The runtime type-check now detects this.
56 lines
1.7 KiB
Plaintext
56 lines
1.7 KiB
Plaintext
#-----------------------------------------------------------------------------#
|
|
|
|
main_target: check
|
|
|
|
include ../Mmake.common
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
PROGS= qual_basic_test qual_basic_test2 qual_is_test qual_adv_test \
|
|
pragma_c_code pragma_inline higher_order_func_test \
|
|
free_free_mode func_test string_alignment tim_qual1 c_write_string \
|
|
no_fully_strict float_rounding_bug string_loop func_and_pred \
|
|
cc_nondet_disj bidirectional address_of_builtins \
|
|
reverse_arith curry curry2 higher_order_syntax \
|
|
ho_func_reg float_reg write expand ho_solns write_reg1 \
|
|
ho_univ_to_type
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
# we need to pass `--infer-all' when compiling func_test.m
|
|
func_test.c: func_test.m
|
|
$(MCG) --grade $(GRADE) $(MCGFLAGS) --infer-all func_test.m \
|
|
> func_test.err 2>&1
|
|
|
|
# we need to pass `--no-fully-strict' when compiling no_fully_strict.m
|
|
no_fully_strict.c: no_fully_strict.m
|
|
$(MCG) --grade $(GRADE) $(MCGFLAGS) --no-fully-strict \
|
|
no_fully_strict.m > no_fully_strict.err 2>&1
|
|
|
|
# no_fully_strict is expected to fail (it calls error/1)
|
|
# so we need to ignore the exit status (hence the leading `-')
|
|
no_fully_strict.out: no_fully_strict
|
|
-./no_fully_strict > no_fully_strict.out 2>&1;
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
DEPS= $(PROGS:%=%.dep)
|
|
DEPENDS=$(PROGS:%=%.depend)
|
|
OUTS= $(PROGS:%=%.out)
|
|
RESS= $(PROGS:%=%.res)
|
|
MODS= $(PROGS:%=%.mod)
|
|
|
|
#-----------------------------------------------------------------------------#
|
|
|
|
dep: $(DEPS)
|
|
|
|
depend: $(DEPENDS)
|
|
|
|
check: $(OUTS) $(RESS)
|
|
|
|
mods: $(MODS)
|
|
|
|
all: $(PROGS)
|
|
|
|
#-----------------------------------------------------------------------------#
|