[Issue 8413] New: enforce breaks compilation of property function
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jul 22 14:56:22 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8413
Summary: enforce breaks compilation of property function
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: major
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2012-07-22 14:56:18 PDT ---
struct Foo
{
int[] arr;
@property int front(string file = __FILE__, size_t line = __LINE__)()
{
enforce(arr.length, format("%s(%s): Cannot call back on empty array.",
file, line));
return arr.front;
}
}
void main()
{
Foo foo;
auto x = foo.front;
}
test.d(28): Error: cannot resolve type for foo.front(string file =
__FILE__,uint line = __LINE__)
If you remove enforce it compiles with no problems.
--
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