[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Pnet-developers] Should this code compile or now ?
From: |
Gopal V |
Subject: |
Re: [Pnet-developers] Should this code compile or now ? |
Date: |
Tue, 3 Jun 2003 12:36:19 +0530 |
User-agent: |
Mutt/1.2.5i |
If memory serves me right, Rhys Weatherley wrote:
> > Good luck trying to fix this - you'll probably have to make the operators
> > modal with an ILGenInfo flag for "evaluating an enum constant". Ick!
>
> Actually, an easier way to fix this may be in the lvalue code that fetches
> constants (the call to FieldToConstant in SemToLRValue). If the compiler is
> in the "evaluating an enumerated constant value" mode, then return the
> underlying type in the CSSemValue, not the enumerated type (this is around
> line 578 of cs_lvalue.tc).
>
> That will probably be better than hacking every operator to recognise
> enumerated values as integers.
Hmm... this would make more sense . But this would mean every compiler
dev has to build it himself :-)
I think I fixed it with a couple of lines and no ILGenInfo option :-)
And if I forgot to mention , Dinosaurs d=Dinosaurs.Rex + Dinosaurs.Stegy
also fails to compile for pnet ... (but since 99% of all enum operations are
either '|' or '&' , this is a rare case ;-)
Going on to fix that ... (and an initializer overflow bug , like
Int32.MaxValue+1 for an int32 enum initializer compiles as of now).
Gopal
--
The difference between insanity and genius is measured by success