D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7816 - non-virtual template methods in interface unsupported
Summary: non-virtual template methods in interface unsupported
Status: RESOLVED DUPLICATE of issue 4174
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-03 11:33 UTC by Martin Nowak
Modified: 2012-04-04 17:44 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Martin Nowak 2012-04-03 11:33:50 UTC
cat > bug.d << CODE
class Foo
{
    final void fcall(T)(T t) { }
    static void scall(T)(T t) {}
}

interface Bar
{
    final void fcall(T)(T t) { }
    static void scall(T)(T t) {}
}

class Baz : Bar {}

void test()
{
    Foo foo; foo.fcall(2); foo.scall(2);
    Bar bar; bar.fcall(2); bar.scall(2);
    Baz baz; baz.fcall(2); baz.scall(2);
}
CODE

dmd -c bug.d

--------

Templates should be able to add methods that are proven
to be non-virtual. This already works for classes.
Comment 1 yebblies 2012-04-04 17:44:34 UTC

*** This issue has been marked as a duplicate of issue 4174 ***