On 6/23/15 4:53 PM, sigod wrote:
Hi. I have few questions about this piece of code.
```
import vibe.data.serialization;
struct User
{
@name("_id") int id; // Error: function expected before (), not
name of type string
string name;
}
```
Is it even proper compiler behavior?
Yes, name lookup looks in local scope first, then outside. D does not
have a requirement to order declarations that aren't inside a function body.
Is there any way to bypass it
without using alias (e.g. `alias named = name;`)?
You can use @full.path.name
You may be able to use @.name, but I'm not sure that parses.
-Steve