digitalmars.D.bugs - [Issue 8265] New: Pseudo member function not found when called across modules
- d-bugmail puremagic.com (53/53) Jun 19 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8265
http://d.puremagic.com/issues/show_bug.cgi?id=8265 Summary: Pseudo member function not found when called across modules Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: tommitissari hotmail.com --- Comment #0 from Tommi <tommitissari hotmail.com> 2012-06-19 05:26:34 PDT --- // File: main.d module main; import test; struct MyStruct { int _value; int memberGetValue() { return _value; } } int nonMemberGetValue(MyStruct ms) { return ms._value; } int main(string[] argv) { static assert(test.memberTest(MyStruct(42))); // #0: OK static assert(MyStruct(42).nonMemberGetValue() == 42); // #1: OK static assert(test.nonMemberTest(MyStruct(42))); // #2 return 0; } //... // File: test.d module test; bool memberTest(T)(T t) { return t.memberGetValue() == 42; } bool nonMemberTest(T)(T t) { return t.nonMemberGetValue() == 42; // #3 } // #2: Error: template instance test.nonMemberTest!(MyStruct) // error instantiating // #3: Error: undefined identifier 'nonMemberGetValue' -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jun 19 2012