www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14914] New: Inconsistent alias declaration could be detected


          Issue ID: 14914
           Summary: Inconsistent alias declaration could be detected
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: bb.temp gmx.com

It's possible to alias a method from one class instance in another one but the
declaration is actually unusable. Example:

class Foo
    void something(size_t param){}

class Bar
    private Foo foo;
    this(){foo = new Foo;}
    alias somethingelse0 = foo.something;
    //alias somethingelse1 = typeof(foo).something;// equivalent

void main(string[] args)
    auto bar = new Bar;

'Bar.somethingelse0' or 'Bar.somethingelse1' are indeed methods but they are
not callable.

To be more clear, the problem is that the alias declaration is legal but it
cannot be used.

Aug 13 2015