Bug 3247 – Crash on overriding class methods with 'auto' return type

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2009-08-12T07:27:00Z
Last change time
2015-06-09T01:28:05Z
Keywords
ice-on-valid-code
Assigned to
nobody
Creator
jarrett.billingsley

Comments

Comment #0 by jarrett.billingsley — 2009-08-12T07:27:58Z
class A { auto foo() { return 0; } } class B : A { override auto foo() { return 5; } } The compiler crashes. It also crashes if A.foo's return type is int or B.foo's return type is int (but not if both are int, obviously). It doesn't crash if foo is not overridden.
Comment #1 by clugdbug — 2009-08-12T08:48:53Z
Is it the same as bug#3042?
Comment #2 by clugdbug — 2009-08-12T08:51:45Z
With my patch for bug #3042 applied, this generates: bug.d(4): Error: function ice.B.foo of type () overrides but is not covariant w ith ice.A.foo of type () So marking as duplicate. *** This issue has been marked as a duplicate of issue 3042 ***