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

dart2js warnings for unimplemented methods with noSuchMethod #16030

Closed
blois opened this issue Jan 11, 2014 · 2 comments
Closed

dart2js warnings for unimplemented methods with noSuchMethod #16030

blois opened this issue Jan 11, 2014 · 2 comments
Labels
closed-obsolete Closed as the reported issue is no longer relevant type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js

Comments

@blois
Copy link
Contributor

blois commented Jan 11, 2014

Compiling the class:
@Proxy
class Context implements Map {
  noSuchMethod(invocation) => mirror.reflect({}).delegate(invocation);
}

Generates warnings about not implementing Map functions:
Warning: 'Context' doesn't implement 'isEmpty'.
Try adding an implementation of 'isEmpty'

From: https://www.dartlang.org/docs/spec/latest/dart-language-specification.html#h.n9p3c8rq84d5

It is a static warning if a concrete class does not have an implementation for a method in any of its superinterfaces unless it declares its own noSuchMethod method (7.10) or is annotated with @­proxy.

@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) and removed priority-unassigned labels Feb 29, 2016
@greglittlefield-wf
Copy link
Contributor

Every component declared using over_react results in a similar error:

[Warning from Dart2JS]:
example/people_list/main.dart:48:1:
'ExampleProps' doesn't implement 'abstract ReactElement call([dynamic a, dynamic a1, dynamic a2, dynamic a3, dynamic a4, dynamic a5, dynamic a6, dynamic a7, dynamic a8, dynamic a9, dynamic a10, dynamic a11, dynamic a12, dynamic a13, dynamic a14, dynamic a15, dynamic a16, dynamic a17, dynamic a18, dynamic a19, dynamic a20, dynamic a21, dynamic a22, dynamic a23, dynamic a24, dynamic a25, dynamic a26, dynamic a27, dynamic a28, dynamic a29, dynamic a30, dynamic a31, dynamic a32, dynamic a33, dynamic a34, dynamic a35, dynamic a36, dynamic a37, dynamic a38, dynamic a39])' declared in 'UiProps'.
Try adding an implementation of 'call' or declaring 'ExampleProps' to be 'abstract'.
class ExampleProps extends UiProps {    /* GENERATED CONSTANTS */ static const ConsumedProps $consumedProps = const ConsumedProps($props, $propKeys); static const List<PropDescriptor> $props = const []; static const List<String> $propKeys = const []; }
^^^^^
[Info from Dart2JS on workspaces_components|example/people_list/main.dart]:
packages/over_react/src/component_declaration/component_base.dart:356:3:
The method 'call' is declared here in class 'UiProps'.
  ReactElement call([children, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40]);
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The gist of what's going on:

class ExampleProps extends UiProps {}

class UiProps implements Function {
  ReactElement call([children, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, c16, c17, c18, c19, c20, c21, c22, c23, c24, c25, c26, c27, c28, c29, c30, c31, c32, c33, c34, c35, c36, c37, c38, c39, c40]);

  dynamic noSuchMethod(Invocation i) {
    ...
  }
}

Is this the same issue? Or is it different since ExampleProps doesn't have noSuchMethod?

@greglittlefield-wf
Copy link
Contributor

Based on #24337, I would expect my example to not emit warnings.

greglittlefield-wf added a commit to greglittlefield-wf/over_react that referenced this issue Mar 1, 2017
Do so by making the original props class abstract and redeclaring
`call` in the impl class.

We can safely make this abstract, since we already have a runtime
warning when it's instantiated.
@matanlurey matanlurey added the closed-obsolete Closed as the reported issue is no longer relevant label Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) web-dart2js
Projects
None yet
Development

No branches or pull requests

4 participants