[nem-en] RFC: matching variant options against non-variant values

vc vc at rsdn.ru
Mon Apr 30 23:40:35 CEST 2007


> I've just commited a change on trunk to disallow the following code:
> 
> foo (o : object) : void
> {
>   match (o) {
>     | [ x, y ] => ... x + y ...
>     | _ => ...
>   }
> }
> ...

Michał, after this commit in Integration project appears many error
messages.

We use object fields for keep data of different types (for examle, TExpr and
Parsetree.Fun_parm):

_pexprObject = match (_pexprObject :> PExpr)
{
| PExpr.As    (_, Splicable.Name as name) when IsIn(name.Location)
| PExpr.Member(_, Splicable.Name as name) when IsIn(name.Location) => ...
| parm is P.Fun_parm when IsIn(parm.name.Location) => setobj(parm.name);
| o => o;
}

This change duress we make many changes :(.




More information about the devel-en mailing list