Bug 6915 – "pure" after template constraint too

Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-11-08T19:23:00Z
Last change time
2012-12-27T18:05:06Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-11-08T19:23:08Z
This is a correct D2 program: int foo(T)(T x) pure nothrow if (is(T == int)) { return x; } void main() { foo(5); } I think tags like "pure" and "nothrow" (and @safe) should be accepted written after the template constraint too: int foo(T)(T x) if (is(T == int)) pure nothrow { return x; } void main() { foo(5); } DMD 2.057head gives: test5.d(1): semicolon expected following function declaration test5.d(2): Declaration expected, not 'return'
Comment #1 by andrej.mitrovich — 2012-12-27T18:05:06Z
*** This issue has been marked as a duplicate of issue 4946 ***