afrog33k / runsharp

Automatically exported from code.google.com/p/runsharp
MIT License
1 stars 1 forks source link

Incorrect ordering of modifiers #2

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Write code like the following:

MyClass.Public.SimpleProperty(MyClass.Field(typeof(object), 
"testProperty"), "TestProperty");

What is the expected output? What do you see instead?

The property should be public and the field private. However, the modifiers 
are reversed, because the Public property is evaluated before the Field() 
invocation, which consumes the modifier state, and is in turn evaluated 
before the SimpleProperty() invocation. 

Fix Proposal: Modifier properties should return some kind of state object 
(with interface identical to the generator, e.g. TypeGen), not 'this'.

Original issue reported on code.google.com by StefanSi...@gmail.com on 16 Oct 2009 at 8:03

GoogleCodeExporter commented 9 years ago
Priority changed to Medium - after all, it's easy to avoid this issue by 
avoiding 
nested declarations.

Original comment by StefanSi...@gmail.com on 16 Oct 2009 at 8:08