Browse thread
Bug with include and module types ?
- Benedikt Grundmann
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Benedikt Grundmann <benedikt.grundmann@g...> |
| Subject: | Bug with include and module types ? |
Hi list,
I stumbled across something which I believe to be a bug in the ocaml
module type language:
Objective Caml version 3.11.0
# module type S = sig val foo : string -> string -> int val bar :
string -> string end;;
module type S =
sig val foo : string -> string -> int val bar : string -> string end
# module type B = sig include S val foo : string -> int end;;
module type B =
sig
val foo : string -> string -> int
val bar : string -> string
val foo : string -> int
end
#
Observe that if you do the same thing in the module language, the
behavior is different
(imho correct) and foo is shadowed:
# module S = struct let foo x y = 1 let bar s = s end ;;
module S : sig val foo : 'a -> 'b -> int val bar : 'a -> 'a end
# module B = struct include S let foo x = 1 end;;
module B : sig val bar : 'a -> 'a val foo : 'a -> int end
Cheers,
Bene
--
Calvin: I try to make everyone's day a little more
surreal.
(From Calvin & Hobbes)