Skip to content

Dartdoc does not accept super calls from mixins #1541

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

Closed
sigurdm opened this issue Nov 20, 2017 · 6 comments
Closed

Dartdoc does not accept super calls from mixins #1541

sigurdm opened this issue Nov 20, 2017 · 6 comments
Assignees
Labels
customer-flutter Issues originating from important to Flutter P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@sigurdm
Copy link
Contributor

sigurdm commented Nov 20, 2017

To reproduce (using flutter):

$ flutter create -t plugin test_plugin
$ cd test_plugin

Replace lib/test_plugin.dart with

import 'package:flutter/widgets.dart';

class A extends StatefulWidget {
  @override
  _AState createState() => new _AState();
}

class _AState extends State<A> with SingleTickerProviderStateMixin {
  @override
  Widget build(BuildContext context) {
    return new Container();
  }
}

Run

$ export FLUTTER_ROOT=~/path/to/flutter
$ ~/path/to/flutter/bin/cache/dart-sdk/bin/dartdoc
Generating documentation for 'test_plugin' into /Users/sigurdm/projects/test_plugin/doc/api/

parsing lib/test_plugin.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/collection/collection.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/developer/developer.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/internal/internal.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/io/io.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/isolate/isolate.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/async/async.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/convert/convert.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/typed_data/typed_data.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/_empty.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/math/math.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/core/core.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/_http/http.dart...
parsing /Users/sigurdm/projects/flutter/bin/cache/pkg/sky_engine/lib/ui/ui.dart...
parsed 12 files in 8.8 seconds
[error] The class 'SingleTickerProviderStateMixin' can't be used as a mixin because it extends a class other than Object. at lib/test_plugin.dart, line 8.
[error] The class 'SingleTickerProviderStateMixin' can't be used as a mixin because it references 'super'. at lib/test_plugin.dart, line 8.

Generation failed: encountered 2 analysis errors.
@sigurdm
Copy link
Contributor Author

sigurdm commented Nov 20, 2017

cc @jcollins-g

@mit-mit
Copy link
Member

mit-mit commented Nov 20, 2017

It's also failing for me on some of the packages we have already published, for example on device_info:

Generating documentation for 'device_info' into C:\Users\mit\dev\github\plugins\packages\device_info\doc\api\

parsing lib\device_info.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\collection\collection.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\developer\developer.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\internal\internal.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\io\io.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\isolate\isolate.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\async\async.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\convert\convert.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\typed_data\typed_data.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\_empty.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\math\math.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\core\core.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\_http\http.dart...
parsing C:\Users\mit\dev\github\flutter\bin\cache\pkg\sky_engine\lib\ui\ui.dart...
parsed 12 files in 7.2 seconds

Generation failed: Unknown type GenericFunctionTypeElementImpl
package:dartdoc/src/model.dart 1991                                                           new ModelElement.from
package:dartdoc/src/model.dart 1188                                                           Field._setModelType
package:dartdoc/src/model.dart 1055                                                           new Field
package:dartdoc/src/model.dart 1956                                                           new ModelElement.from
package:dartdoc/src/model.dart 821                                                            Class._allFields.<fn>
dart:core                                                                                     Iterable.toList

@mit-mit
Copy link
Member

mit-mit commented Nov 20, 2017

Looks like "my issue" is #1497, which was fixed later than the current version of dartdoc inside flutter...

@sigurdm
Copy link
Contributor Author

sigurdm commented Nov 20, 2017

The problem with the super mixin seems to be still present in dartdoc version: 0.14.1 from Dart VM version: 2.0.0-dev.8.0 (Fri Nov 17 13:53:29 2017) on "macos_ia32"

@jcollins-g
Copy link
Contributor

@mit-mit : dartdoc used by flutter is at 0.14.1: https://github.com/flutter/flutter/blob/master/dev/bots/docs.sh#L13

@jcollins-g jcollins-g added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Nov 20, 2017
@jcollins-g jcollins-g self-assigned this Nov 20, 2017
@jcollins-g jcollins-g added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Nov 20, 2017
@jcollins-g
Copy link
Contributor

This looks like more fallout of the general problem that dartdoc does not obey analysis_options files. A side-effect of #1524 will make the general problem more likely to get fixed (reduced number of ways that the analyzer is invoked to one inside dartdoc) but there's no fix on deck yet for this or the specific issue filed.

@jcollins-g jcollins-g added the customer-flutter Issues originating from important to Flutter label Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-flutter Issues originating from important to Flutter P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants