Skip to content

ocamlc -i produces incorrect result #4791

@vicuna

Description

@vicuna

Original bug ID: 4791
Reporter: jerhoud
Status: acknowledged (set by @damiendoligez on 2009-05-15T15:09:02Z)
Resolution: open
Priority: low
Severity: feature
Version: 3.10.2
Target version: later
Category: typing
Has duplicate: #6323 #7402
Related to: #6416 #6634 #6654 #7458
Parent of: #6587

Bug description

cat a.ml

(* begin of a.ml *)
type t = A

module B =
struct
type t = B

let f A = B
end
(* end of a.ml *)

ocamlc -i a.ml

type t = A
module B : sig type t = B val f : t -> t end

The type of f is incorrect, it should be something like "val f : A.t -> B.t" except that there seems to be no way of actually writing a correct signature for module B (both A.t and B.t are unbound at this stage).

On the other hand, other definitions using f seem to be typed correctly.

I may admit that there is no way to solve this problem, but ocamlc -i should report an error instead of producing an incorrect result.

File attachments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions