[m-rev.] diff: Enable two test cases for checking final insts.

Peter Wang novalazy at gmail.com
Fri Feb 20 15:20:34 AEDT 2015


Enable two test cases for checking final insts.

These test cases were not enabled before due to problems with the mode
checker, since fixed in commit 491bb0ab5f19745635058a99dcc02bcbd748fc49
and thereabouts.

tests/invalid/Mmakefile:
	Enable ho_default_func_4 and inst_matches_final_bug.

tests/invalid/ho_default_func_4.m:
	Update module import.

tests/invalid/ho_default_func_4.err_exp:
tests/invalid/inst_matches_final_bug.err_exp:
	Add expected outputs.

diff --git a/tests/invalid/Mmakefile b/tests/invalid/Mmakefile
index a3aa0de..d05c85b 100644
--- a/tests/invalid/Mmakefile
+++ b/tests/invalid/Mmakefile
@@ -120,6 +120,7 @@ SINGLEMODULE= \
 	ho_any_inst \
 	ho_default_func_1 \
 	ho_default_func_3 \
+	ho_default_func_4 \
 	ho_type_mode_bug \
 	ho_unique_error \
 	illtyped_compare \
@@ -129,6 +130,7 @@ SINGLEMODULE= \
 	inconsistent_instances \
 	inline_conflict \
 	inst_list_dup \
+	inst_matches_final_bug \
 	instance_bug \
 	instance_no_type \
 	instance_var_bug \
@@ -312,9 +314,6 @@ NON_PROFDEEP_MODULES = \
 #		normal static linking; the error goes undetected
 #		when doing dynamic linking)
 #	parent.undeclared_child (just not yet implemented)
-#	ho_default_func_4 (due to a bug in the mode-checker ---
-#			see XXX comment in inst_match:inst_matches_final_3)
-#	inst_matches_final_bug (due to same bug as ho_default_func_4)
 #	bad_detism (error check not yet implemented)
 #	typeclass_dup_method_mode (error check NYI - just calls error)
 
diff --git a/tests/invalid/ho_default_func_4.err_exp b/tests/invalid/ho_default_func_4.err_exp
index e69de29..3d1fb8d 100644
--- a/tests/invalid/ho_default_func_4.err_exp
+++ b/tests/invalid/ho_default_func_4.err_exp
@@ -0,0 +1,15 @@
+ho_default_func_4.m:036: In clause for `baz(in, out)':
+ho_default_func_4.m:036:   in call to function `univ.univ'/1:
+ho_default_func_4.m:036:   mode error: arguments `TypeInfo_9, V_7, V_6' have
+ho_default_func_4.m:036:   the following insts:
+ho_default_func_4.m:036:     bound(private_builtin.type_info(bound(<type_ctor_info
+ho_default_func_4.m:036:     for .func/0>), bound(2), bound(<type_ctor_info for
+ho_default_func_4.m:036:     .int/0>), bound(<type_ctor_info for .int/0>))),
+ho_default_func_4.m:036:     /* unique */(func(($typed_inst(int,
+ho_default_func_4.m:036:     (ho_default_func_4.one)) >> $typed_inst(int,
+ho_default_func_4.m:036:     (ho_default_func_4.one)))) = (free >> ground) is
+ho_default_func_4.m:036:     det),
+ho_default_func_4.m:036:     free
+ho_default_func_4.m:036:   which does not match any of the modes for function
+ho_default_func_4.m:036:   `univ.univ'/1.
+For more information, recompile with `-E'.
diff --git a/tests/invalid/ho_default_func_4.m b/tests/invalid/ho_default_func_4.m
index cce11ae..035cdce 100644
--- a/tests/invalid/ho_default_func_4.m
+++ b/tests/invalid/ho_default_func_4.m
@@ -16,7 +16,7 @@
 :- implementation.
 
 :- import_module int.
-:- import_module std_util.
+:- import_module univ.
 
 :- inst one == bound(1).
 
diff --git a/tests/invalid/inst_matches_final_bug.err_exp b/tests/invalid/inst_matches_final_bug.err_exp
index e69de29..3593dfe 100644
--- a/tests/invalid/inst_matches_final_bug.err_exp
+++ b/tests/invalid/inst_matches_final_bug.err_exp
@@ -0,0 +1,6 @@
+inst_matches_final_bug.m:023: In clause for `return_three = out(bound(3))':
+inst_matches_final_bug.m:023:   mode error: argument 1 did not get sufficiently
+inst_matches_final_bug.m:023:   instantiated.
+inst_matches_final_bug.m:023:   Final instantiatedness of `HeadVar__1' was
+inst_matches_final_bug.m:023:   `ground',
+inst_matches_final_bug.m:023:   expected final instantiatedness was `bound(3)'.
-- 
2.1.2




More information about the reviews mailing list