D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5393 - opDispatch with template this parameter fails to compile
Summary: opDispatch with template this parameter fails to compile
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: patch, rejects-valid
Depends on:
Blocks:
 
Reported: 2010-12-31 05:51 UTC by Jacob Carlborg
Modified: 2012-01-03 04:49 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jacob Carlborg 2010-12-31 05:51:59 UTC
When compiling the following code:

class A
{
    void opDispatch (string name, this T) () { }
}

class B : A {}

void main ()
{
    auto b = new B;
    b.foobar();
}

I get this error:

Error: template instance opDispatch!("foobar") does not match template declaration opDispatch(string name,this T)

DMD v2.051
Comment 1 kennytm 2011-04-25 14:13:14 UTC
Probably depends on issue 5886.