caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Bug report: Caml-Light 0.5
@ 1993-05-10  7:15 murthy
  0 siblings, 0 replies; only message in thread
From: murthy @ 1993-05-10  7:15 UTC (permalink / raw)
  To: caml-list


It seems to me that there should at least be some sort of error
message, saying that I cannot redefine constructors.

--chet--
------------------------------------------
vougeot:camllight
>       Caml Light version 0.5

#type foo = A of int | B of bool;;
Type foo defined.
#let mkA x = A x
and mkB x = B x;;
mkA : int -> foo = <fun>
mkB : bool -> foo = <fun>
#let A 5 = 5 and B 5 = 5;;
> Toplevel input:
>let A 5 = 5 and B 5 = 5;;
>                ^^^^^^^
> Warning: pattern matching is not exhaustive

> Toplevel input:
>let A 5 = 5 and B 5 = 5;;
>    ^^^^^^^
> Warning: pattern matching is not exhaustive

A : int -> int = <fun>
B : int -> int = <fun>
#A 5;;
- : foo = A 5
#B true;;
- : foo = B true
#B 5;;
> Toplevel input:
>B 5;;
>  ^
> Expression of type int
> cannot be used with type bool
#





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1993-05-10  7:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1993-05-10  7:15 Bug report: Caml-Light 0.5 murthy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).