I meant that A.err refers precisely to the full type declaration
type err = [ `A | `B ]
both its left-hand side and right hand side. In other words, [ A.err | `Another_err ] merely inlines the type definition of A.err in the type expression and nothing more.
okay, [ A.err | 'Another_err ] inlines the definition of A.err, but that’s only possible if we know that A.err is a polymorphic variant
the issue in the original code example:
module type A = sig type err end
module type B = sig
module A : A
type err = [ A.err | `Another_err ]
end
is that A.err does not expand to a polymorphic variant type - it is simply an unknown type
Is there any way to say that module A in module B, will have a type err, that is a polymorphic variant, so that type err = [ A.err | 'Another_err ] compiles?