Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aliases show up twice in code completion. #41

Closed
PhilipWitte opened this issue Jan 31, 2012 · 1 comment
Closed

aliases show up twice in code completion. #41

PhilipWitte opened this issue Jan 31, 2012 · 1 comment

Comments

@PhilipWitte
Copy link

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.

@aBothe
Copy link
Owner

aBothe commented Feb 3, 2012

Since name duplicates aren't shown in the completion list anymore, I guess it's mostly acceptable if equally-named aliases are marked as overloads

@aBothe aBothe closed this as completed Feb 3, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants