[Issue 6915] New: "pure" after template constraint too
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 8 19:23:44 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6915
Summary: "pure" after template constraint too
Product: D
Version: D2
Platform: Other
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2011-11-08 19:23:08 PST ---
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'
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list