[nem-en] patch for matching compiler

Kamil Skalski kamil.skalski at gmail.com
Thu Oct 27 10:50:00 CEST 2005


Why doing things twice, when they can be done only once?
I guess the location passing should be fixed, because it is also used
even later, during IL generation. This would be one more step towards
getting correct locations in debug symbols.

2005/10/27, Michal Moskal <michal.moskal at gmail.com>:
> On 10/27/05, Marcin Grzeskowiak <fnord at silesianet.pl> wrote:
> > I don't know yet how to fix this but the problem is caused by
> > the fact that when -new-matching option is specified
> > the DecisionTreeBuilder.CheckMatching function (responsible for
> > warnings) is invoked later in the compilation process than when
> > compiler is run without the option.
> [...]
> > is related to the way DecisionTreeBuilder treats enums. If the enum
> > declaration has [System.Flags] attribute its span is -1 ("infinite")
> > which means that it can be assigned any value that is correct for
> > the underlying int type. Without [System.Flags] however the span of
> > enum type is equal to the number of named constants in enum. This
> > is generally not correct but works nice for CheckMatching () (resulting
> > in better warning messages) and unfortunately breaks my patch.
>
> Maybe you could run the decision tree building as usual for warnings,
> and run it again for regular matching compilation, treating all enums
> with infinite span?
>
> --
>    Michal Moskal,
>    http://nemerle.org/~malekith/
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>


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



More information about the devel-en mailing list