2024-07-16 01:49 AEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000076mercuryBugpublic2008-08-22 13:12
Assigned Towangp 
Product Version 
Target VersionFixed in Version 
Summary0000076: --make-opt-int incorrectly handles existentially typed methods
DescriptionThe compiler aborts when making a .opt file if the module contains a
typeclass instance which implements a method with existentially typed
arguments, but the predicate which implements the method is not itself
existentially typed, e.g.

    :- typeclass dynamic_block(T) where [
    some [Q] pred generate_block(T::in, Q::out) is det

    :- instance dynamic_block(simple_dynamic_block) where [
    pred(generate_block/2) is do_generate_block

    :- pred do_generate_block(simple_dynamic_block::in, string::out) is det.

% mmc --make-opt-int intermod_typeclass_exist
Uncaught Mercury exception:
Software Error: pred_table.m: Unexpected: type error in pred call: no matching pred
Stack dump follows:
   0 pred exception.throw/1-0 (erroneous) (exception.m:388)
   1 pred require.error/1-0 (erroneous) (require.m:122)
   2 pred libs.compiler_util.unexpected/2-0 (erroneous) (compiler_util.m:87)
   3 pred hlds.pred_table.resolve_pred_overloading/7-0 (det) (pred_table.m:983)
   4 pred transform_hlds.intermod.qualify_instance_method/5-0 (det) (intermod.m:907)
   5 pred list.map_foldl/5-1 (det) (list.m:2292)
   6 pred transform_hlds.intermod.gather_instances_3/5-0 (det) (intermod.m:822)
   7 pred list.foldl/4-1 (det) (list.m:2164)
   8 pred transform_hlds.intermod.gather_instances_2/5-0 (det) (intermod.m:786)
   9 2* pred tree234.foldl/4-0 (det) (tree234.m:2506 and others)
  11 pred map.foldl/4-0 (det) (map.m:863)
  12 pred transform_hlds.intermod.gather_instances/2-0 (det) (intermod.m:779)
  13 pred transform_hlds.intermod.write_opt_file/4-0 (det) (intermod.m:171)
  14 pred top_level.mercury_compile.maybe_write_optfile/7-0 (det) (mercury_compile.m:2287)
  15 pred top_level.mercury_compile.frontend_pass_no_type_error/9-0 (det) (mercury_compile.m:2238)
  16 pred top_level.mercury_compile.frontend_pass/11-0 (det) (mercury_compile.m:2110)
  17 pred top_level.mercury_compile.mercury_compile/8-0 (det) (mercury_compile.m:1499)
  18 pred top_level.mercury_compile.compile/10-0 (det) (mercury_compile.m:1478)

TagsNo tags attached.
Attached Files




wangp (developer)

Patch committed 2008-08-22.

-Issue History
Date Modified Username Field Change
2008-08-14 15:13 wangp New Issue
2008-08-14 15:13 wangp File Added: intermod_typeclass_exist.m
2008-08-22 13:12 wangp Status new => resolved
2008-08-22 13:12 wangp Resolution open => fixed
2008-08-22 13:12 wangp Assigned To => wangp
2008-08-22 13:12 wangp Note Added: 0000141
+Issue History