Bug 4698 – Can't add constraints to templated class that uses inheritance
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-08-20T17:48:00Z
Last change time
2010-08-20T20:55:45Z
Keywords
rejects-valid
Assigned to
nobody
Creator
dsimcha
Comments
Comment #0 by dsimcha — 2010-08-20T17:48:36Z
import std.range;
class Foo {}
class Bar(T) : Foo if(isInputRange!T) {}
test9.d(4): members expected
test9.d(4): { } expected following aggregate declaration
test9.d(4): Declaration expected, not 'if'
Comment #1 by Kosmonaut — 2010-08-20T20:52:33Z
This works:
---
class Foo {}
class Bar(T) if(isInputRange!T) : Foo {}
---
I'm pretty sure that someone already filled a bug about this issue. Couldn't find it though.
Comment #2 by Kosmonaut — 2010-08-20T20:55:45Z
*** This issue has been marked as a duplicate of issue 3673 ***