[Issue 4289] New: template struct opEquals problem
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Jun 6 12:30:52 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4289
Summary: template struct opEquals problem
Product: D
Version: future
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-06-06 12:30:50 PDT ---
The syntax of this D2 code seems correct (removing the const this code used to
work in D1):
struct Foo(size_t N) {
bool opEquals(ref const(Foo!(N))) const {
return false;
}
}
alias Foo!(2) Foo2;
void main() {}
But DMD v2.046 prints at compile-time:
test.d(2): Error: function test.Foo!(2).Foo.opEquals type signature should be
const bool(ref const(Foo!(2))) not const bool(ref const(Foo!(N)))
test.d(6): Error: template instance test.Foo!(2) error instantiating
--
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