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

           Summary: Poorly formed error against non-const template on
                    const object
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: jesse.k.phillip...@gmail.com
                CC: jesse.k.phillip...@gmail.com


--- Comment #0 from Jesse Phillips <jesse.k.phillip...@gmail.com> 2010-10-22 
09:18:10 PDT ---
The program below fails to compile because the MyClass.get template method is
not const. But this report is on the error message returned:

.\templateconst.d(10): Error: function
std.variant.VariantN!(maxSize).VariantN.g
et!(double).get () is not callable using argument types ()

I would expect it to complain that the call was not to a const method on a
const object.


void main() {
   MyClass a;
   test(a);
}

void test(const MyClass c) {
   auto b = c.get!double;
}

class MyClass {
   real pi = 3.14;

   T get(T)() {
      return cast(T) pi;
   }
}

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

Reply via email to