Closed
Description
Version: 9.1.4
Assume we have the following code of name b.res
:
module Types : {
module B : {
type t = private int
}
} = {
module B = {
type t = private int
}
}
open Types
module B = {
open B
let t : t = Obj.magic(42)
}
This fails with a FAILED: B has a self cycle
error despite that this does not contain any dependency to itself.
The open B
actually refers to Types.B
, but the compiler falsely detects it as a self-reference.
Interestingly, when you remove the explicit module type of the Types
module, it compiles correctly:
module Types = {
module B = {
type t = private int
}
}
open Types
module B = {
open B
let t : t = Obj.magic(42)
}
Metadata
Metadata
Assignees
Labels
No labels