Version française
Home     About     Download     Resources     Contact us    
Browse thread
Fragile pattern matching?!
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alex Baretta <alex@b...>
Subject: Fragile pattern matching?!
We have an incomprehensibile warning when compiling code that looks like 
the following:

type value =
   | Int of int
   | Float of float
   | Int32 of int32
   | Int64 of int64
   | Bool of bool
   | String of string

let to_int value = match value with
   | Int x -> x
   | _ -> raise Some_exception

The compiler signals a warning for a fragile pattern matching at the "_" 
character.

Why in the world should this code signal such a warning?

Alex


-- 
*********************************************************************
http://www.barettadeit.com/
Baretta DE&IT
A division of Baretta SRL

tel. +39 02 370 111 55
fax. +39 02 370 111 54

Our technology:

The Application System/Xcaml (AS/Xcaml)
<http://www.asxcaml.org/>

The FreerP Project
<http://www.freerp.org/>