[Bug 125] New: forward reverence with covariant return type
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu May 4 09:01:10 PDT 2006
http://d.puremagic.com/bugzilla/show_bug.cgi?id=125
Summary: forward reverence with covariant return type
Product: D
Version: 0.150
Platform: PC
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: benoit at tionex.de
class UA{
A f(){ return null; }
}
class UB : UA {
B f(){ return null; }
}
class A{
}
class B : A{
}
Gives this:
snippets/cov.d(12): class snippets.cov.B base class is forward referenced by A
snippets/cov.d(7): function snippets.cov.UB.f of type B() overrides but is not
covariant with snippets.cov.UA.f of type A()
snippets/cov.d(12): class snippets.cov.B base class is forward referenced by A
Moving A,B before the decl of UA,UB solves the problem.
--
More information about the Digitalmars-d-bugs
mailing list