[Issue 1997] Better type inference for templated types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 10 08:46:36 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=1997


Jesse Phillips <Jesse.K.Phillips+D at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |Jesse.K.Phillips+D at gmail.co
                   |                            |m
            Version|unspecified                 |2.041


--- Comment #1 from Jesse Phillips <Jesse.K.Phillips+D at gmail.com> 2010-03-10 08:46:35 PST ---
DMD includes private methods when it tries to match for type inference even
though the private function is not available.

.\test.d(10): Error: template bar.Bar(T) does not match any function template
declaration
.\test.d(10): Error: template bar.Bar(T) cannot deduce template function from
argument types !()(void delegate())

------------------
module bar;

import foo;

void Bar(T)(void delegate(T) call) {
}

void main() {
   auto foo = new Foo();
   Bar(&foo.fish);
}

------------------
module foo;

class Foo {
   private void fish() {
   }
   public void fish(string color) {
   }
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list