Skip to content

Crash on redundant with type expression #1397

@lukemaurer

Description

@lukemaurer

Getting a crash on the following MRE:

module type S = sig
  module A : sig
    module B : sig
      type t
    end
  end

  module B = A.B
end

module type M = sig
  type t

  module N : sig
    include S with type A.B.t = t and type B.t = t
  end
end

Obviously the and type B.t = t bit doesn't do anything (since A.B.t was already made equal to t and B is an alias for A.B), but it does cause odoc to crash with Exception handling module: B/11. Fortunately, since the extra equality doesn't do anything, a suitable workaround is to delete it.

Backtrace:

Exception handling module: B/11
backtrace:
Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
Called from Odoc_xref2__Lang_of.Path.module_ in file "src/xref2/lang_of.ml", line 63, characters 12-67
Called from Odoc_xref2__Lang_of.Path.module_ in file "src/xref2/lang_of.ml", line 76, characters 27-40
Called from Odoc_xref2__Lang_of.u_module_type_expr in file "src/xref2/lang_of.ml", line 801, characters 50-80
Called from Odoc_xref2__Lang_of.module_type_expr in file "src/xref2/lang_of.ml", line 821, characters 19-59
Called from Odoc_xref2__Lang_of.module_decl in file "src/xref2/lang_of.ml", line 763, characters 33-70
Called from Odoc_xref2__Lang_of.module_ in file "src/xref2/lang_of.ml", line 734, characters 14-48

odoc: internal error, uncaught exception:
      Failure("Not_found: A/8")
      Raised at Stdlib.failwith in file "stdlib.ml", line 29, characters 17-33
      Called from Odoc_xref2__Lang_of.Path.module_ in file "src/xref2/lang_of.ml", line 63, characters 12-67
      Called from Odoc_xref2__Lang_of.Path.module_ in file "src/xref2/lang_of.ml", line 76, characters 27-40
      Called from Odoc_xref2__Lang_of.u_module_type_expr in file "src/xref2/lang_of.ml", line 801, characters 50-80
      Called from Odoc_xref2__Lang_of.module_type_expr in file "src/xref2/lang_of.ml", line 821, characters 19-59
      Called from Odoc_xref2__Lang_of.module_decl in file "src/xref2/lang_of.ml", line 763, characters 33-70
      Called from Odoc_xref2__Lang_of.module_ in file "src/xref2/lang_of.ml", line 734, characters 14-48
      Re-raised at Odoc_xref2__Lang_of.module_ in file "src/xref2/lang_of.ml", line 742, characters 4-11
      Called from Odoc_xref2__Lang_of.signature_items.inner in file "src/xref2/lang_of.ml", line 409, characters 48-71
      Called from Odoc_xref2__Lang_of.signature in file "src/xref2/lang_of.ml", line 460, characters 12-43
      Called from Odoc_xref2__Lang_of.simple_expansion in file "src/xref2/lang_of.ml", line 605, characters 30-51
      Called from Odoc_xref2__Compile.include_.get_expansion in file "src/xref2/compile.ml", line 427, characters 25-70
      Called from Odoc_xref2__Compile.signature_items.loop in file "src/xref2/compile.ml", line 347, characters 27-41
      Called from Odoc_xref2__Compile.signature in file "src/xref2/compile.ml", line 364, characters 19-49
      Called from Odoc_xref2__Compile.module_type_expr in file "src/xref2/compile.ml", line 705, characters 29-49
      Called from Odoc_xref2__Compile.module_decl in file "src/xref2/compile.ml", line 381, characters 34-64
      Called from Odoc_xref2__Compile.module_ in file "src/xref2/compile.ml", line 375, characters 19-67
      Called from Odoc_xref2__Compile.signature_items.loop in file "src/xref2/compile.ml", line 277, characters 21-34
      Called from Odoc_xref2__Compile.signature in file "src/xref2/compile.ml", line 364, characters 19-49
      Called from Odoc_xref2__Compile.module_type_expr in file "src/xref2/compile.ml", line 705, characters 29-49
      Called from Odoc_xref2__Compile.module_type in file "src/xref2/compile.ml", line 398, characters 21-71
      Called from Odoc_xref2__Compile.signature_items.loop in file "src/xref2/compile.ml", line 322, characters 21-39
      Called from Odoc_xref2__Compile.signature in file "src/xref2/compile.ml", line 364, characters 19-49
      Called from Odoc_xref2__Compile.content.(fun) in file "src/xref2/compile.ml", line 100, characters 15-54
      Called from Odoc_xref2__Compile.unit in file "src/xref2/compile.ml", line 68, characters 21-47
      Called from Odoc_xref2__Lookup_failures.with_ref in file "src/xref2/lookup_failures.ml", line 13, characters 10-14
      Called from Odoc_xref2__Lookup_failures.catch_failures in file "src/xref2/lookup_failures.ml", line 60, characters 20-37
      Called from Odoc_odoc__Compile.resolve_and_substitute in file "src/odoc/compile.ml", line 148, characters 4-49
      Called from Odoc_model__Error.catch in file "src/model/error.ml", line 52, characters 21-27
      Called from Odoc_model__Error.catch_warnings.(fun) in file "src/model/error.ml", line 87, characters 18-22
      Called from Odoc_model__Error.with_ref in file "src/model/error.ml", line 65, characters 12-16
      Re-raised at Odoc_model__Error.with_ref in file "src/model/error.ml", line 70, characters 4-11
      Called from Odoc_odoc__Compile.compile.(fun) in file "src/odoc/compile.ml", line 401, characters 6-206
      Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 24, characters 19-24
      Called from Cmdliner_term.app.(fun) in file "cmdliner_term.ml", line 22, characters 12-19
      Called from Cmdliner_eval.run_parser in file "cmdliner_eval.ml", line 35, characters 37-44

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions