[nem-en] patch for matching compiler

Kamil Skalski kamil.skalski at gmail.com
Tue Oct 25 23:26:10 CEST 2005


Ok, now it boots and tests are running well. There is one regression
in location of reported warning in new-matching-null.n
without -new-matching the location is
positive/new-matching-null.n:97:7:97:12: warning: matching is not
exhaustive, example unmatched value: V.A (a = V.A, b = B)

and with it
positive/new-matching-null.n:96:5:96:8: warning: matching is not
exhaustive, example unmatched value: V.A (a = V.A, b = B)

05-10-25, Kamil Skalski <kamil.skalski at gmail.com> napisał(a):
> 05-10-25, Marcin Grzeskowiak <fnord at silesianet.pl> napisał(a):
> >
> > The code that works for me:
> >
> > public static IsTupleMember (ty : IMember) : bool
> > {
> >    def dt = ty.DeclaringType;
> >    def typarms = dt.TyparmsCount;
> >    typarms > 1 && dt.Equals (InternalType.GetTupleType (typarms).tycon)
> > }
> >
> > Seems that without tycon the Object.Equals () method is called in the last
> > line (my guess).
>
> Ooops. This is a perfect example for the bug introduced because of
> Equals (o : object), I was calling it between  TypeInfo and MType, so
> it was just always failing.
>
> --
> Kamil Skalski
> http://nazgul.omega.pl
>


--
Kamil Skalski
http://nazgul.omega.pl


More information about the devel-en mailing list