www.fgks.org   »   [go: up one dir, main page]

Issue 21883 - poor error message when swapping order of base class and interface
Summary: poor error message when swapping order of base class and interface
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords: pull
: 21653 (view as issue list)
Depends on:
Blocks:
 
Reported: 2021-04-30 16:54 UTC by Adam D. Ruppe
Modified: 2021-05-03 09:17 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Adam D. Ruppe 2021-04-30 16:54:04 UTC
module test;

interface InterfaceA {
    void method();
}

class ClassA {
    string somefield;
    void method2() {}
}

class ClassB: InterfaceA, ClassA { // unhelpful error message
    void method() {}
}
Comment 1 Dlang Bot 2021-04-30 16:57:26 UTC
@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 Dlang Bot 2021-04-30 23:21:34 UTC
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 Mathias LANG 2021-05-03 09:17:40 UTC
*** Issue 21653 has been marked as a duplicate of this issue. ***