Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0004531OCamlOCaml generalpublic2008-04-09 13:442013-08-31 12:46
Reporterfpessaux 
Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionsuspended 
PlatformOSOS Version
Product Version3.10.1 
Target VersionFixed in Version 
Summary0004531: Redefinition of exceptions, matching and equality are odd
DescriptionI know, it' evil to re-define things, but... ;)

exception Foo of int ;;
let x = Foo 0 ;;
exception Foo of bool ;;
let y = Foo false ;;
x = y ;;
-----> <true>. Pretty strange since arguments do not have the same type.

x == y ;;
-----> <false>. Right, mostly satisfactory.

match x with
| Foo a -> false
| whatever -> whatever = x && whatever = y
;;
Result is <true>. This means that it appears that the match "knew" that x was defined using the now "masked" constructor Foo, hence do not take the first case. However, the second case when taken, reveals that x is not "matchingly" equal to an (certain) Foo but is equal to ... both.

Where am I wrong ?
TagsNo tags attached.
Attached Files

- Relationships
duplicate of 0001248closed Generation d'exceptions 

-  Notes
(0004490)
frisch (developer)
2008-04-09 17:01

Cf the discussion after bug 0001248.
(0006795)
doligez (administrator)
2012-01-25 15:01

See PR#1248 for the status of this problem.

- Issue History
Date Modified Username Field Change
2008-04-09 13:44 fpessaux New Issue
2008-04-09 17:01 frisch Note Added: 0004490
2008-04-10 14:51 doligez Relationship added related to 0001248
2008-04-10 14:51 doligez Status new => acknowledged
2012-01-25 15:01 doligez Relationship replaced duplicate of 0001248
2012-01-25 15:01 doligez Note Added: 0006795
2012-01-25 15:01 doligez Status acknowledged => resolved
2012-01-25 15:01 doligez Resolution open => suspended
2013-08-31 12:46 xleroy Status resolved => closed


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker