Bug 125 – forward reference with covariant return type
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-05-04T11:01:00Z
Last change time
2014-02-15T02:09:56Z
Keywords
rejects-valid
Assigned to
bugzilla
Creator
benoit
Comments
Comment #0 by benoit — 2006-05-04T11:01:09Z
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.