Zoltan Somogyi
748a22a882
Improve diagnostics for bad instance declarations.
...
compiler/check_typeclass.m:
When a type in an instance declaration is not a type constructor,
don't just say what it is; say also what it should be.
When a type in an instance declaration is a type constructor but some
of its arguments are not type variables, don't just say so: say *which*
of their arguments are the problem.
Do not use "argument" to refer to both "the arguments of the instance
declaration" and the "arguments of a type constructor"; use the terminology
"instance type" for the former.
Always end the line after the ":" in the error's top level description.
Omit the module qualification of the typeclass name in error messages,
since the base name of the typeclass, and the context, should always
be enough to eliminate any ambiguity.
Fix a bug in the use of choose_number.
Don't gather the set of seen types, since it was never used.
tests/invalid/invalid_instance_declarations.m:
Extend this test to type classes with more than one type.
tests/invalid/bad_instance2.err_exp:
tests/invalid/constraint_proof_bug_lib.err_exp:
tests/invalid/fundeps_coverage.err_exp:
tests/invalid/instance_var_bug.err_exp:
tests/invalid/invalid_instance_declarations.err_exp:
tests/invalid/range_restrict.err_exp:
tests/invalid/tc_err1.err_exp:
tests/invalid/tc_err2.err_exp:
tests/invalid/typeclass_bogus_method.err_exp:
tests/invalid/typeclass_missing_mode_2.err_exp:
tests/invalid/typeclass_test_10.err_exp:
tests/invalid/typeclass_test_3.err_exp:
tests/invalid/typeclass_test_4.err_exp:
tests/invalid/typeclass_test_5.err_exp:
tests/invalid/typeclass_test_9.err_exp:
Update these expected outputs to account for the changes above.
2018-06-27 19:57:03 +02:00
..
2017-08-22 10:36:12 +10:00
2017-08-22 10:36:12 +10:00
2017-08-22 10:36:12 +10:00
2017-06-29 00:15:11 +02:00
2017-06-28 17:11:26 +02:00
2017-06-28 19:51:56 +02:00
2017-06-28 19:51:56 +02:00
2017-06-28 17:11:26 +02:00
2017-06-28 17:11:26 +02:00
2015-11-29 04:33:41 +11:00
2015-11-29 04:33:41 +11:00
2017-09-22 05:04:34 +10:00
2015-12-14 11:36:43 +11:00
2016-06-22 20:17:19 +10:00
2016-06-22 20:17:19 +10:00
2016-01-13 02:03:16 +11:00
2016-05-26 13:02:27 +10:00
2016-05-26 13:02:27 +10:00
2018-02-02 05:54:55 +11:00
2016-05-26 13:02:27 +10:00
2017-03-16 11:07:09 +11:00
2016-05-19 23:30:21 +10:00
2018-02-02 05:54:55 +11:00
2016-05-25 16:00:50 +10:00
2017-03-16 11:07:09 +11:00
2017-03-16 09:54:09 +11:00
2017-03-16 20:43:59 +11:00
2016-05-25 16:00:50 +10:00
2017-03-17 14:55:31 +11:00
2016-05-30 14:29:41 +10:00
2018-01-31 17:54:40 +11:00
2017-06-27 18:15:58 +02:00
2015-11-22 00:34:50 +11:00
2017-12-15 14:31:44 +11:00
2017-12-15 14:31:44 +11:00
2017-11-09 17:07:38 +11:00
2017-08-06 23:13:52 +02:00
2018-06-27 19:57:03 +02:00
2015-11-11 14:28:57 +11:00
2017-04-01 20:20:57 +11:00
2016-01-11 23:05:39 +11:00
2017-12-12 13:47:14 +11:00
2015-11-16 22:41:49 +11:00
2016-06-22 20:17:19 +10:00
2016-06-22 20:17:19 +10:00
2018-01-31 17:54:40 +11:00
2015-11-29 04:33:41 +11:00
2015-11-29 16:06:35 +11:00
2015-11-29 16:06:35 +11:00
2017-04-01 20:20:57 +11:00
2015-11-11 14:28:57 +11:00
2015-11-30 16:50:06 +11:00
2015-11-30 16:50:06 +11:00
2016-08-30 18:37:19 +10:00
2015-10-31 19:05:49 +11:00
2016-06-29 21:54:40 +10:00
2016-06-29 21:54:40 +10:00
2016-08-30 18:37:19 +10:00
2015-11-04 20:12:11 +11:00
2016-06-29 21:54:40 +10:00
2016-06-29 21:54:40 +10:00
2016-04-19 18:05:39 +10:00
2016-04-19 18:05:39 +10:00
2015-10-22 07:37:19 +11:00
2015-10-22 06:42:05 +11:00
2015-11-26 07:35:39 +11:00
2017-06-24 23:13:47 +02:00
2017-06-17 02:55:30 +02:00
2016-08-30 18:37:19 +10:00
2016-08-30 18:37:19 +10:00
2018-02-27 01:57:24 +11:00
2017-05-03 09:45:17 +10:00
2017-04-01 20:20:57 +11:00
2016-05-26 23:54:48 +10:00
2016-02-08 16:09:01 +11:00
2016-05-26 23:54:48 +10:00
2016-04-14 23:43:37 +10:00
2018-02-02 05:54:55 +11:00
2016-08-30 18:37:19 +10:00
2017-06-24 23:13:47 +02:00
2016-04-17 18:59:34 +10:00
2018-06-27 19:57:03 +02:00
2017-06-08 14:52:46 +02:00
2017-06-08 14:52:46 +02:00
2016-05-13 11:46:37 +10:00
2016-05-13 11:46:37 +10:00
2016-05-13 11:46:37 +10:00
2017-04-19 20:53:40 +10:00
2015-11-22 16:51:22 +11:00
2015-12-02 23:09:03 +11:00
2015-11-02 13:09:37 +11:00
2017-02-19 21:54:27 +11:00
2016-05-13 05:48:47 +10:00
2018-02-27 01:57:24 +11:00
2017-03-15 19:46:16 +11:00
2018-02-24 13:50:52 +11:00
2018-01-31 17:54:40 +11:00
2016-03-13 01:11:05 +11:00
2016-03-13 01:11:05 +11:00
2017-06-27 18:15:58 +02:00
2017-05-03 09:45:17 +10:00
2017-05-03 09:45:17 +10:00
2017-05-03 09:45:17 +10:00
2017-05-03 09:45:17 +10:00
2015-10-02 12:47:58 +10:00
2016-06-17 22:43:16 +10:00
2018-02-27 01:57:24 +11:00
2016-05-19 23:30:21 +10:00
2017-04-01 20:20:57 +11:00
2017-06-29 00:15:11 +02:00
2017-06-28 17:11:26 +02:00
2016-01-02 00:58:59 +11:00
2017-06-27 18:15:58 +02:00
2017-04-01 20:20:57 +11:00
2016-04-17 14:53:15 +10:00
2016-02-08 16:09:01 +11:00
2016-02-08 16:09:01 +11:00
2016-02-08 16:09:01 +11:00
2016-02-08 16:09:01 +11:00
2016-02-08 16:09:01 +11:00
2016-02-08 16:09:01 +11:00
2018-06-27 19:57:03 +02:00
2015-11-03 14:46:08 +11:00
2017-04-01 20:20:57 +11:00
2015-10-07 00:44:14 +11:00
2015-10-07 00:44:14 +11:00
2015-11-29 04:33:41 +11:00
2015-11-29 04:33:41 +11:00
2015-11-29 04:33:41 +11:00
2015-11-29 04:33:41 +11:00
2016-08-30 18:37:19 +10:00
2015-11-29 04:33:41 +11:00
2017-04-01 20:20:57 +11:00
2016-07-17 10:20:29 +02:00
2017-09-22 05:04:34 +10:00
2017-04-01 20:20:57 +11:00
2017-04-01 20:20:57 +11:00
2018-06-27 19:57:03 +02:00
2017-01-29 14:38:26 +11:00
2017-01-12 01:10:31 +11:00
2017-01-16 16:24:48 +11:00
2017-01-12 01:10:31 +11:00
2017-01-16 16:24:48 +11:00
2017-01-12 01:10:31 +11:00
2017-01-29 14:38:26 +11:00
2017-01-12 01:10:31 +11:00
2018-06-27 19:57:03 +02:00
2018-06-27 19:57:03 +02:00
2017-09-13 22:16:29 -04:00
2017-09-13 22:16:29 -04:00
2017-09-13 22:16:29 -04:00
2017-09-13 22:16:29 -04:00
2017-09-13 22:16:29 -04:00
2017-09-13 22:16:29 -04:00
2018-02-04 07:32:21 -05:00
2018-02-04 07:32:21 -05:00
2018-03-09 14:22:32 +11:00
2017-08-21 09:50:16 +10:00
2017-08-21 09:50:16 +10:00
2017-01-29 14:38:26 +11:00
2017-01-12 01:10:31 +11:00
2016-05-19 23:30:21 +10:00
2016-05-19 23:30:21 +10:00
2017-04-01 20:20:57 +11:00
2017-09-13 22:16:29 -04:00
2017-09-13 22:16:29 -04:00
2017-09-13 22:16:29 -04:00
2017-09-13 22:16:29 -04:00
2017-09-13 22:16:29 -04:00
2017-09-13 22:16:29 -04:00
2018-02-04 07:32:21 -05:00
2018-02-04 07:32:21 -05:00
2017-04-26 11:38:34 +10:00
2017-04-26 11:38:34 +10:00
2016-03-13 01:11:05 +11:00
2016-03-13 01:11:05 +11:00
2016-04-14 23:43:37 +10:00
2016-05-20 05:47:36 +10:00
2016-04-03 22:48:56 +10:00
2015-11-28 07:46:33 +11:00
2015-11-27 22:49:58 +11:00
2017-10-12 01:08:30 +11:00
2016-08-30 18:37:19 +10:00
2017-04-19 20:53:40 +10:00
2015-12-03 05:06:28 +11:00
2017-04-01 20:20:57 +11:00
2017-04-01 20:20:57 +11:00
2018-02-04 07:32:21 -05:00
2016-10-15 17:26:32 +11:00
2016-01-13 02:03:16 +11:00
2017-06-08 14:52:46 +02:00
2017-04-19 20:53:40 +10:00
2016-04-26 14:50:18 +10:00
2017-05-20 21:13:04 +02:00
2017-05-20 21:13:04 +02:00
2015-11-29 04:33:41 +11:00
2016-06-20 21:29:32 +10:00
2017-04-01 20:20:57 +11:00
2016-03-13 01:11:05 +11:00
2016-01-02 13:16:14 +11:00
2017-06-22 01:37:42 +02:00
2016-08-30 18:37:19 +10:00
2018-01-31 17:54:40 +11:00
2018-01-31 17:54:40 +11:00
2015-11-22 00:34:50 +11:00
2016-04-26 14:50:18 +10:00
2016-04-14 23:43:37 +10:00
2015-11-29 04:33:41 +11:00
2018-06-27 19:57:03 +02:00
2016-05-20 05:47:36 +10:00
2017-06-24 23:13:47 +02:00
2015-11-18 00:40:05 +11:00
2016-05-13 05:48:47 +10:00
2016-04-10 12:54:03 +10:00
2016-04-10 12:54:03 +10:00
2017-03-30 17:14:46 +11:00
2017-10-12 01:08:30 +11:00
2017-03-30 17:14:46 +11:00
2017-03-30 17:14:46 +11:00
2017-10-12 01:08:30 +11:00
2017-03-30 17:14:46 +11:00
2017-03-30 17:14:46 +11:00
2017-10-12 01:08:30 +11:00
2017-03-30 17:14:46 +11:00
2017-09-22 05:04:34 +10:00
2015-12-16 22:47:08 +11:00
2015-11-28 07:46:33 +11:00
2016-05-20 05:47:36 +10:00
2016-05-20 05:47:36 +10:00
2016-05-13 05:48:47 +10:00
2016-05-13 05:48:47 +10:00
2018-06-27 19:57:03 +02:00
2018-06-27 19:57:03 +02:00
2016-01-11 23:05:39 +11:00
2015-11-28 07:46:33 +11:00
2017-04-01 20:20:57 +11:00
2016-03-13 01:11:05 +11:00
2015-11-28 07:46:33 +11:00
2015-11-29 04:33:41 +11:00
2018-01-31 17:54:40 +11:00
2017-03-15 12:34:32 +11:00
2017-09-22 05:04:34 +10:00
2016-03-13 01:11:05 +11:00
2015-11-04 22:29:53 +11:00
2017-04-01 20:20:57 +11:00
2016-01-13 02:03:16 +11:00
2016-01-13 02:03:16 +11:00
2018-06-27 19:57:03 +02:00
2016-03-18 12:06:10 +11:00
2016-01-13 02:03:16 +11:00
2018-06-27 19:57:03 +02:00
2017-06-24 23:13:47 +02:00
2015-11-04 20:12:11 +11:00
2015-11-04 20:12:11 +11:00
2018-06-27 19:57:03 +02:00
2018-06-27 19:57:03 +02:00
2018-06-27 19:57:03 +02:00
2018-06-27 19:57:03 +02:00
2018-06-27 19:57:03 +02:00
2017-04-01 20:20:57 +11:00
2017-04-01 20:20:57 +11:00
2016-01-13 02:03:16 +11:00
2017-04-01 20:20:57 +11:00
2017-04-01 20:20:57 +11:00
2017-04-01 20:20:57 +11:00
2017-04-01 20:20:57 +11:00
2015-11-16 22:41:49 +11:00
2016-03-13 01:11:05 +11:00
2016-03-13 01:11:05 +11:00
2016-05-19 23:30:21 +10:00
2016-05-19 23:30:21 +10:00
2018-04-07 18:25:43 +10:00
2017-06-27 18:15:58 +02:00
2018-01-31 17:54:40 +11:00
2015-10-06 00:38:11 +11:00
2015-10-06 00:38:11 +11:00
2016-04-14 23:43:37 +10:00
2018-01-31 17:54:40 +11:00
2017-04-01 20:20:57 +11:00
2018-01-31 17:54:40 +11:00
2016-04-26 14:50:18 +10:00
2016-06-22 13:29:28 +02:00
2016-06-22 13:29:28 +02:00
2017-04-01 20:20:57 +11:00
2015-12-03 05:06:28 +11:00