Issue 660 - [D1] Incorrect protection error message
Summary: [D1] Incorrect protection error message
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: All All
: P2 normal
Assignee: Walter Bright
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2006-12-06 16:42 UTC by Carlos Santander
Modified: 2019-05-11 16:28 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Carlos Santander 2006-12-06 16:42:45 UTC
(sorry for not finding a better summary)

//-------------------
class A
{
        void foo () {}
        private
        static void foo (int i) {}
}

class B
{
        void foo (int x)
        {
                A.foo (x);
        }
}
//-------------------
$ gdmd -c test1.d
test1.d:12: class test1.B member foo is not accessible
//-------------------
Comment 2 Don 2012-02-01 22:32:25 UTC
This is actually a bit worse. If you swap the order of the private static
and public virtual foo, it compiles!

class A
{
    private static void foo(int i) {}
    public void foo() {}
}

class B
{
    void bar(int x)
    {
       A.foo (x);
    }
}