ocaml-doc / doc-ock

(DEPRECATED) Documentation generation for OCaml
ISC License
15 stars 5 forks source link

Including signatures with substituted types from 'include module type of' crashes #57

Closed dsheets closed 8 years ago

dsheets commented 8 years ago

Compiling imto.mli:

include module type of Module

include S with type t = int

against module.ml:

module type S = sig type t end

results in


internal error, uncaught exception:
CamlinternalLazy.Undefined
Raised at file "camlinternalLazy.ml", line 18, characters 48-57
Called from file "camlinternalLazy.ml", line 25, characters 17-27
Re-raised at file "camlinternalLazy.ml", line 32, characters 10-11
Called from file "camlinternalLazy.ml", line 25, characters 17-27
Re-raised at file "camlinternalLazy.ml", line 32, characters 10-11
Called from file "_build/lib-doc-ock/docOckComponentTbl.cml-native", line 398, characters 17-49
Called from file "_build/lib-doc-ock/docOckComponentTbl.cml-native", line 165, characters 19-56
Called from file "camlinternalLazy.ml", line 25, characters 17-27
Re-raised at file "camlinternalLazy.ml", line 32, characters 10-11
Called from file "camlinternalLazy.ml", line 25, characters 17-27
Re-raised at file "camlinternalLazy.ml", line 32, characters 10-11
Called from file "_build/lib-doc-ock/docOckResolve.cml-native", line 231, characters 18-31
Called from file "_build/lib-doc-ock/docOckResolve.cml-native", line 839, characters 31-71
Called from file "list.ml", line 55, characters 20-23
Called from file "_build/lib-doc-ock/docOckResolve.cml-native", line 832, characters 12-1001
Called from file "_build/lib-doc-ock/docOckMaps.cml-native", line 1268, characters 22-48
Called from file "_build/lib-doc-ock/docOckMaps.cml-native", line 9, characters 15-18
Called from file "_build/lib-doc-ock/docOckMaps.cml-native", line 12, characters 19-31
Called from file "_build/lib-doc-ock/docOckMaps.cml-native", line 1960, characters 23-43
Called from file "_build/lib-doc-ock/docOckMaps.cml-native", line 1977, characters 19-44
Called from file "_build/lib-doc-ock/docOckResolve.cml-native", line 912, characters 18-29
Called from file "map.ml", line 192, characters 19-42
Called from file "_build/lib-codoc/codocIndex.ml", line 405, characters 14-103
Called from file "_build/bin-codoc/codocCliLink.ml", line 116, characters 13-54
lpw25 commented 8 years ago

The problem was actually with including a module that was itself introduced by an include. This is now fixed but it required a slight change to DocOckTypes so that includes now have their own type rather than just using ModuleType.expr. This is probably the right thing to do anyway and it opens the door to the possibility of supporting doc comments on includes.

lpw25 commented 8 years ago

Note that it is probably still possible to cause a CamlinternalLazy.Undefined exception in some other cases. I aim to fix this shortly.

dsheets commented 8 years ago

Cool! I couldn't trigger it with only the inclusion, iirc, the subexpression under with was necessary to cause the issue. I confirm that this is fixed.