aBothe/Mono-D — Issue #41: aliases show up twice in code completion.
Author: PhilipWitte
Created: 2012-01-31 01:51:57+00:00
State: open

````D
struct Vector(uint S, T) if (S > 1)
{
T[S] data;

private @property
{
auto _get(uint U)() { return data[U]; }
void _set(uint U)(T value) { data[U] = value; }
}

alias _get!0 x;
alias _set!0 x;

alias _get!1 y;
alias _set!1 y;
}

void main()
{
auto vv = Vector!(2, float)();

vv.x = 32; // 'x' shows up twice in code-completion list
writeln(vv.y); // ditto for 'y'
}
````

It's a minor bug, and the example above isn't a realistic use-case-scenario, but gl3n makes use of "double aliases" for GLSL style vector property access (eg, vec1.xyz += vec2.yzz;) and I'm using them in some areas as well.