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

Static warning when concrete class extends Function and does not have call() #16280

Closed
DartBot opened this issue Jan 24, 2014 · 6 comments
Closed
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-not-planned Closed as we don't intend to take action on the reported issue
Milestone

Comments

@DartBot
Copy link

DartBot commented Jan 24, 2014

This issue was originally filed by yu.asakusa...@gmail.com


What steps will reproduce the problem?

  1. In Dart Editor, enter the following code:
    class MyClass extends Function {}
  2. See the warning.

What is the expected output? What do you see instead?
Actual warning:
“Concrete classes that implement Function must implement the method call()”
but note that MyClass does not implement Function. It extends Function.

What version of the product are you using? On what operating system?
Dart Editor version 1.2.0.edge_031984
Dart SDK version 1.2.0-edge.31984
downloaded from
http://storage.googleapis.com/dart-archive/channels/be/raw/latest/editor/darteditor-windows-x64.zip

Please provide any additional information below.

I think that there are two issues here.

First, it is unclear whether this case should be a static warning or not according to the language specification 1.1. Section 15.5, “Function Types”, states:

> It is a static warning if a concrete class implements Function and does not have a concrete method named call().

but I cannot find an analogous description of the case where the class in question extends Function.

Judging from issue #7780, the intent seems to be that this case should also be a static warning.

Second, provided that this is indeed a static warning, the warning message is not exactly correct. It should be something along:
“Concrete classes that extend or implement Function must implement the method call()”

@sgjesse
Copy link
Contributor

sgjesse commented Jan 24, 2014

Added Area-Language label.

@sgjesse
Copy link
Contributor

sgjesse commented Jan 24, 2014

Added Triaged label.

@gbracha
Copy link
Contributor

gbracha commented Aug 27, 2014

If a class C extends a class S, the implicit interface of C implements the implicit interface of S. And so if you extend Function, you do in fact implement it. Anyway, the wording of the warning is up to the analyzer. I don't think any of this is a real problem.

Recategorizing to analyzer in case the team wants to rephrase the message.


Removed Area-Language label.
Added Area-Analyzer label.

@bwilkerson
Copy link
Member

Removed Priority-Unassigned label.
Added Priority-Medium label.

@bwilkerson
Copy link
Member

All of our messages need to be looked at, and we'll address this issue at that time.


Set owner to @bwilkerson.
Added WontFix label.

@clayberg
Copy link

Added this to the 1.8 milestone.

@DartBot DartBot added Type-Defect area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Nov 28, 2014
@DartBot DartBot added this to the 1.8 milestone Nov 28, 2014
@kevmoo kevmoo added closed-not-planned Closed as we don't intend to take action on the reported issue and removed resolution-wont_fix labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. closed-not-planned Closed as we don't intend to take action on the reported issue
Projects
None yet
Development

No branches or pull requests

6 participants