D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4698 - Can't add constraints to templated class that uses inheritance
Summary: Can't add constraints to templated class that uses inheritance
Status: RESOLVED DUPLICATE of issue 3673
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2010-08-20 17:48 UTC by David Simcha
Modified: 2010-08-20 20:55 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 David Simcha 2010-08-20 17:48:36 UTC
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 Kosmonaut 2010-08-20 20:52:33 UTC
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 Kosmonaut 2010-08-20 20:55:45 UTC

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