Browse thread
Why is this allowed?
[
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: | 2010-05-31 (15:49) |
From: | Jacques Carette <carette@m...> |
Subject: | Re: [Caml-list] Why is this allowed? |
Lukasz Stafiniak wrote: > But what when someone includes or opens a module with Foo after "type > foo = Foo"? What when someone opens it locally in an expression? > I would be fine if type-level shadowing was disallowed for all those cases. > Does a variant value have a unique type with a unique path so that it > would be possible to guarantee that within this unique path there are > no type *definitions* that override a variant name? > That would be nice. Jacques > On Mon, May 31, 2010 at 4:46 PM, Jacques Carette <carette@mcmaster.ca> wrote: > >> type foo = Foo >> let x = Foo >> >> type foo2 = Foo | Bar >> let y = Foo >> let z = (x,y) ;; >> >> I thought that re-using of algebraic labels was not allowed - but apparently >> it is? >>