Bug 21883 – poor error message when swapping order of base class and interface

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-04-30T16:54:04Z
Last change time
2021-05-03T09:17:40Z
Keywords
pull
Assigned to
No Owner
Creator
Adam D. Ruppe

Comments

Comment #0 by destructionator — 2021-04-30T16:54:04Z
module test; interface InterfaceA { void method(); } class ClassA { string somefield; void method2() {} } class ClassB: InterfaceA, ClassA { // unhelpful error message void method() {} }
Comment #1 by dlang-bot — 2021-04-30T16:57:26Z
@adamdruppe updated dlang/dmd pull request #12490 "Improve error message for base class followed by interface" fixing this issue: - fix issue #21883 https://github.com/dlang/dmd/pull/12490
Comment #2 by dlang-bot — 2021-04-30T23:21:34Z
dlang/dmd pull request #12490 "Improve error message for base class followed by interface" was merged into master: - c687dc9d70c55cf2ad0de6b74291fe3e119ed15a by Adam D. Ruppe: Improve error message for base class followed by interface The spec requires base class to be listed first, but if you flip it, the compiler complains about multiple inheritance instead of just hinting that you need to reorder your list. This makes the error message a little more user-friendly. fix issue #21883 https://github.com/dlang/dmd/pull/12490
Comment #3 by pro.mathias.lang — 2021-05-03T09:17:40Z
*** Issue 21653 has been marked as a duplicate of this issue. ***