Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Same function reported as missing multiple times #19731

Closed
OndrejSpanel opened this issue Feb 19, 2024 · 1 comment · Fixed by #19800
Closed

Same function reported as missing multiple times #19731

OndrejSpanel opened this issue Feb 19, 2024 · 1 comment · Fixed by #19800
Assignees
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc better-errors Issues concerned with improving confusing/unhelpful diagnostic messages itype:enhancement Spree Suitable for a future Spree
Milestone

Comments

@OndrejSpanel
Copy link
Member

Compiler version

3.0.0-3.4.1-RC1

Minimized example

trait Base {
  def func(): Unit
}

class Derived extends Base {
  def func(): Unit
}

Output Error/Warning message

class Derived needs to be abstract, since:
it has 2 unimplemented members.
/** As seen from class Derived, the missing signatures are as follows.
 *  For convenience, these are usable as stub implementations.
 */
  // Members declared in Base
  def func(): Unit = ???
  
  // Members declared in Derived
  def func(): Unit = ???

class Derived extends Base {

Why this Error/Warning was not helpful

The message was unhelpful because it lists the same function twice. When using this as a stub for implementation, you need to remove it. This is esp. confusing when there are many methods to be implemented.

Suggested improvement

It could be made more helpful by listing each method overload only once. e.g.:

class Derived needs to be abstract, since:
it has 1 unimplemented member.
/** As seen from class Derived, the missing signatures are as follows.
 *  For convenience, these are usable as stub implementations.
 */
  // Members declared in Base
  def func(): Unit = ???
  
class Derived extends Base {
@OndrejSpanel OndrejSpanel added area:reporting Error reporting including formatting, implicit suggestions, etc better-errors Issues concerned with improving confusing/unhelpful diagnostic messages itype:enhancement stat:needs triage Every issue needs to have an "area" and "itype" label labels Feb 19, 2024
@mbovel mbovel added Spree Suitable for a future Spree and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Feb 19, 2024
@mbovel
Copy link
Member

mbovel commented Feb 25, 2024

This issue was picked for the Issue Spree of February 27th, 2024. @hamzaremmal, @AnotherMedo, @entangled90 and @Valentin889 will be working on it. If you have any insight into the issue or guidance on how to fix it, please leave it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:reporting Error reporting including formatting, implicit suggestions, etc better-errors Issues concerned with improving confusing/unhelpful diagnostic messages itype:enhancement Spree Suitable for a future Spree
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants