You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1382 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general) Related to:#3652 Parent of:#3655
Here's 60 lines of source code that breaks the current ocamlc from
CVS. Sorry I can't make it smaller.
It may be significant that the error message ends up mentioning
< format_eventid_tag : 'a. ([> `ANY] as 'b) Conscious.CD.eventid -> unit >
when in the actual code, the type variable argument to
format_eventid_tag is always equal to the type variable in the first
argument. That is, the 'a and 'b should not be different in the
above.
When I have shuffled text so it is less than 3 files, the problem
went away. To reproduce the problem, give these commands:
File "ouch.ml", line 9, characters 22-155:
Signature mismatch:
Modules do not match:
sig
class ['a] structure_read_desc :
object
constraint 'a = [> ANY] method dump : Conscious.CD.formatter -> string array -> unit end end is not included in Event Class declarations do not match: class ['a] structure_read_desc : object constraint 'a = [> ANY]
method dump : Conscious.CD.formatter -> string array -> unit
end
does not match
class ['a] structure_read_desc :
object
constraint 'a = [> ANY] method dump : CD.formatter -> string array -> unit end The class type object method dump : Conscious.CD.formatter -> string array -> unit end is not matched by the class type object method dump : CD.formatter -> string array -> unit end The method dump has type Conscious.CD.formatter -> string array -> unit but is expected to have type CD.formatter -> string array -> unit Type Conscious.CD.formatter = < format_eventid_tag : 'a. ([> ANY] as 'b) Conscious.CD.eventid -> unit >
is not compatible with type
CD.formatter =
< format_eventid_tag : 'c. ([> `ANY] as 'c) CD.eventid -> unit >
Type 'b Conscious.CD.eventid = 'b Conscious_data.Conscious_data.eventid
is not compatible with type
'c CD.eventid = 'c Conscious_data.Conscious_data.eventid
ouch.ml contains:
module CD = Conscious_data.Conscious_data
module C = Conscious.Conscious
module type Event = sig
class ['a] structure_read_desc: [[>`ANY] as 'a] CD.eventdesc
end
(* The : Event is essential to reproducing the problem. *)
module Event: Event = struct
class ['a] structure_read_desc =
object
inherit ['a] C.scalar_eventdesc_impl
method dump f bva = failwith "ouch"
end
end
conscious_data.ml contains:
module type Conscious_data = sig
type 'a eventid
class type formatter =
object
(* The type constraint [>ANY] as 'a is essential to aggravate the problem. *) method format_eventid_tag: 'a . ([>ANY] as 'a) eventid -> unit
end
class type ['a] eventdesc = object
method dump: formatter -> string array -> unit
end
end
(* If I eliminate the :Conscious_data on the next line, the problem goes
away. *)
module Conscious_data: Conscious_data = struct
type 'a eventid = int
class type formatter =
object
method format_eventid_tag: 'a . ([>`ANY] as 'a) eventid -> unit
end
class type ['a] eventdesc = object
method dump: formatter -> string array -> unit
end
end
and conscious.ml contains:
module CD = Conscious_data.Conscious_data
module Conscious = struct
class virtual ['a] scalar_eventdesc_impl =
object (self: 'self)
constraint 'a = [>`ANY]
method virtual dump: CD.formatter -> string array -> unit
constraint 'self = [>`ANY] #CD.eventdesc
end
end
--
Tim Freeman tim@fungible.com
GPG public key fingerprint ECDF 46F8 3B80 BB9E 575D 7180 76DF FE00 34B1 5C78
The text was updated successfully, but these errors were encountered:
Original bug ID: 1382
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Related to: #3652
Parent of: #3655
Bug description
Hmm, this email bounced the first time. Try #2.
Here's 60 lines of source code that breaks the current ocamlc from
CVS. Sorry I can't make it smaller.
It may be significant that the error message ends up mentioning
when in the actual code, the type variable argument to
format_eventid_tag is always equal to the type variable in the first
argument. That is, the 'a and 'b should not be different in the
above.
When I have shuffled text so it is less than 3 files, the problem
went away. To reproduce the problem, give these commands:
and you'll get this compiler error:
File "ouch.ml", line 9, characters 22-155:
Signature mismatch:
Modules do not match:
sig
class ['a] structure_read_desc :
object
constraint 'a = [>
ANY] method dump : Conscious.CD.formatter -> string array -> unit end end is not included in Event Class declarations do not match: class ['a] structure_read_desc : object constraint 'a = [>
ANY]method dump : Conscious.CD.formatter -> string array -> unit
end
does not match
class ['a] structure_read_desc :
object
constraint 'a = [>
ANY] method dump : CD.formatter -> string array -> unit end The class type object method dump : Conscious.CD.formatter -> string array -> unit end is not matched by the class type object method dump : CD.formatter -> string array -> unit end The method dump has type Conscious.CD.formatter -> string array -> unit but is expected to have type CD.formatter -> string array -> unit Type Conscious.CD.formatter = < format_eventid_tag : 'a. ([>
ANY] as 'b) Conscious.CD.eventid -> unit >is not compatible with type
CD.formatter =
< format_eventid_tag : 'c. ([> `ANY] as 'c) CD.eventid -> unit >
Type 'b Conscious.CD.eventid = 'b Conscious_data.Conscious_data.eventid
is not compatible with type
'c CD.eventid = 'c Conscious_data.Conscious_data.eventid
ouch.ml contains:
module CD = Conscious_data.Conscious_data
module C = Conscious.Conscious
module type Event = sig
class ['a] structure_read_desc: [[>`ANY] as 'a] CD.eventdesc
end
(* The : Event is essential to reproducing the problem. *)
module Event: Event = struct
class ['a] structure_read_desc =
object
inherit ['a] C.scalar_eventdesc_impl
method dump f bva = failwith "ouch"
end
end
conscious_data.ml contains:
module type Conscious_data = sig
type 'a eventid
class type formatter =
object
(* The type constraint [>
ANY] as 'a is essential to aggravate the problem. *) method format_eventid_tag: 'a . ([>
ANY] as 'a) eventid -> unitend
class type ['a] eventdesc = object
method dump: formatter -> string array -> unit
end
end
(* If I eliminate the :Conscious_data on the next line, the problem goes
away. *)
module Conscious_data: Conscious_data = struct
type 'a eventid = int
class type formatter =
object
method format_eventid_tag: 'a . ([>`ANY] as 'a) eventid -> unit
end
class type ['a] eventdesc = object
method dump: formatter -> string array -> unit
end
end
and conscious.ml contains:
module CD = Conscious_data.Conscious_data
module Conscious = struct
end
--
Tim Freeman
tim@fungible.com
GPG public key fingerprint ECDF 46F8 3B80 BB9E 575D 7180 76DF FE00 34B1 5C78
The text was updated successfully, but these errors were encountered: