[Mono-dev] Unexpected compiler errors when using "as" keyword

Andreas Nahr ClassDevelopment at A-SoftTech.com
Wed Aug 13 11:37:08 EDT 2008


Just as a very short note without looking in detail:

IMHO C would always work because even if interpreted as 

("blah" + o) as string 

it would be a correct statement (though it wouldn't make any sense to cast
to string).

So the assumption would be that it is just the precedence that is different
in .Net and Mono.

 

Happy hacking

Andreas

I've spent some quality time looking at parser output and the grammar and
I'm
having a hard time understanding why C works, but A doesn't. I'm also
confused
why C works at all since my interpretation of the grammar seems to imply
that
only putting "as" clauses in parenthesis will make them compatible with an
additive-expression.

So here are my questions:
1. Is this a known issue and is someone working on it?
2. Is my interpretation of the grammar(as specified in cs-parser.jay and/or
in the ECMA-334 spec) correct 
   and A & C shouldn't work ?
3. Does anyone have suggestions on how I can get A to work. (I have a lot of
instances of these and it would
   make me sad to have to put () around all them).

Any help would be greatly appreciated.

Thanks,
Aaron

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20080813/d15bc338/attachment.html 


More information about the Mono-devel-list mailing list