[nem-en] patch for matching compiler

Michal Moskal michal.moskal at gmail.com
Thu Oct 27 10:46:45 CEST 2005


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/



More information about the devel-en mailing list