Skip to content
This repository has been archived by the owner on Mar 16, 2020. It is now read-only.

ddc investigation #327

Closed
5 tasks done
devoncarew opened this issue Sep 16, 2015 · 24 comments
Closed
5 tasks done

ddc investigation #327

devoncarew opened this issue Sep 16, 2015 · 24 comments

Comments

@devoncarew
Copy link
Contributor

(redacted to get the checkmarks in the first comment)

@devoncarew
Copy link
Contributor Author

Here's the current breakdown of ddc reported issues (~83 right now). I haven't looked into these too closely. Note that the output of the cli tool is pretty hard to parse -

@devoncarew
Copy link
Contributor Author

Scratch the package:markdown ones - upgrading to 0.8.0 fixed them :)

@vsmenon
Copy link

vsmenon commented Sep 17, 2015

I looked at the ones in package:collection. The overrides are straightforward to fix:

https://codereview.chromium.org/1353873002/

I filed an issue on the best fix for DefaultEquality:

dart-archive/dev_compiler#324

@devoncarew
Copy link
Contributor Author

An update - we went from 85 errors to 55, with fixes to collection, markdown, and pub_semver. Here's the latest when run on dev_compiler 0.1.18:

package:collection

severe: [StaticTypeError] Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<E> (package:collection/equality.dart, line 75, col 31)
severe: [StaticTypeError] Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<E> (package:collection/equality.dart, line 120, col 53)
severe: [StaticTypeError] Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<E> (package:collection/equality.dart, line 205, col 38)
severe: [StaticTypeError] Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<E> (package:collection/equality.dart, line 223, col 38)
severe: [StaticTypeError] Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<K> (package:collection/equality.dart, line 263, col 42)
severe: [StaticTypeError] Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<V> (package:collection/equality.dart, line 264, col 44)

package:frappe

severe: [StaticTypeError] Type check failed: new BufferWhen(toggle) (BufferWhen<dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/event_stream.dart, line 94, col 63)
severe: [StaticTypeError] Type check failed: new ConcatAll() (ConcatAll<dynamic, dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/event_stream.dart, line 100, col 40)
severe: [StaticTypeError] Type check failed: new DoAction(onData, onError: onError, onDone: onDone) (DoAction<dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/event_stream.dart, line 109, col 17)
severe: [StaticTypeError] Type check failed: new FlatMap(convert) (FlatMap<dynamic, dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/event_stream.dart, line 113, col 61)
severe: [StaticTypeError] Type check failed: new Merge(other) (Merge<dynamic, dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/event_stream.dart, line 126, col 48)
severe: [StaticTypeError] Type check failed: new MergeAll() (MergeAll<dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/event_stream.dart, line 128, col 39)
severe: [StaticTypeError] Type check failed: new Scan(initialValue, combine) (Scan<dynamic, dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/event_stream.dart, line 136, col 74)
severe: [StaticTypeError] Type check failed: new SelectFirst(other) (SelectFirst) is not of type StreamTransformer<T, dynamic> (package:frappe/src/event_stream.dart, line 138, col 54)
severe: [StaticTypeError] Type check failed: new BufferWhen(toggle) (BufferWhen<dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/property.dart, line 105, col 60)
severe: [StaticTypeError] Type check failed: new ConcatAll() (ConcatAll<dynamic, dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/property.dart, line 111, col 37)
severe: [StaticTypeError] Type check failed: new DoAction(onData, onError: onError, onDone: onDone) (DoAction<dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/property.dart, line 120, col 17)
severe: [StaticTypeError] Type check failed: new FlatMap(convert) (FlatMap<dynamic, dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/property.dart, line 124, col 58)
severe: [StaticTypeError] Type check failed: new Merge(other) (Merge<dynamic, dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/property.dart, line 145, col 45)
severe: [StaticTypeError] Type check failed: new MergeAll() (MergeAll<dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/property.dart, line 147, col 36)
severe: [StaticTypeError] Type check failed: new Scan(initialValue, combine) (Scan<dynamic, dynamic>) is not of type StreamTransformer<T, dynamic> (package:frappe/src/property.dart, line 155, col 71)
severe: [StaticTypeError] Type check failed: new SelectFirst(other) (SelectFirst) is not of type StreamTransformer<T, dynamic> (package:frappe/src/property.dart, line 157, col 51)

package:stream_transformers

severe: [InvalidMethodOverride] Invalid override. The type of BufferWhen.bind ((Stream<T>) → Stream<T>) is not a subtype of StreamTransformer<dynamic, dynamic>.bind ((Stream<dynamic>) → Stream<dynamic>). (package:stream_transformers/src/buffer_when.dart, line 29, col 3)
severe: [StaticTypeError] Type check failed: new Scan({}, (previous, current) {var values = new Map.from(previous); values[current.first] = current.last; return values;}) (Scan<dynamic, dynamic>) is not of type StreamTransformer<List<dynamic>, dynamic> (package:stream_transformers/src/combine.dart, line 30, col 61)
severe: [InvalidMethodOverride] Invalid override. The type of ConcatAll.bind ((Stream<T>) → Stream<R>) is not a subtype of StreamTransformer<dynamic, dynamic>.bind ((Stream<dynamic>) → Stream<dynamic>). (package:stream_transformers/src/concat_all.dart, line 35, col 3)
severe: [InvalidMethodOverride] Invalid override. The type of DoAction.bind ((Stream<T>) → Stream<T>) is not a subtype of StreamTransformer<dynamic, dynamic>.bind ((Stream<dynamic>) → Stream<dynamic>). (package:stream_transformers/src/do_action.dart, line 43, col 3)
severe: [InvalidMethodOverride] Invalid override. The type of FlatMap.bind ((Stream<S>) → Stream<T>) is not a subtype of StreamTransformer<dynamic, dynamic>.bind ((Stream<dynamic>) → Stream<dynamic>). (package:stream_transformers/src/flat_map.dart, line 22, col 3)
severe: [StaticTypeError] Type check failed: new FlatMap((value) => _convert(value).transform(new TakeUntil(done.stream))) (FlatMap<dynamic, dynamic>) is not of type StreamTransformer<S, dynamic> (package:stream_transformers/src/flat_map_latest.dart, line 30, col 22)
severe: [InvalidMethodOverride] Invalid override. The type of Merge.bind ((Stream<S>) → Stream<dynamic>) is not a subtype of StreamTransformer<dynamic, dynamic>.bind ((Stream<dynamic>) → Stream<dynamic>). (package:stream_transformers/src/merge.dart, line 31, col 3)
severe: [InvalidMethodOverride] Invalid override. The type of MergeAll.bind ((Stream<T>) → Stream<dynamic>) is not a subtype of StreamTransformer<dynamic, dynamic>.bind ((Stream<dynamic>) → Stream<dynamic>). (package:stream_transformers/src/merge_all.dart, line 27, col 3)
severe: [StaticTypeError] Type check failed: new FlatMap((stream) => stream) (FlatMap<dynamic, dynamic>) is not of type StreamTransformer<T, dynamic> (package:stream_transformers/src/merge_all.dart, line 28, col 29)
severe: [StaticTypeError] Type check failed: new FlatMapLatest((value) {return _bindStream(onListen: (EventSink<T> sink) {return trigger.listen((_) => sink.add(value), onError: sink.addError, onDone: sink.close);});}) (FlatMapLatest<dynamic, dynamic>) is not of type StreamTransformer<T, dynamic> (package:stream_transformers/src/sample_on.dart, line 41, col 22)
severe: [InvalidMethodOverride] Invalid override. The type of Scan.bind ((Stream<A>) → Stream<R>) is not a subtype of StreamTransformer<dynamic, dynamic>.bind ((Stream<dynamic>) → Stream<dynamic>). (package:stream_transformers/src/scan.dart, line 29, col 3)
severe: [StaticTypeError] Type check failed: new When(_signal.map((_) => true)) (When<dynamic>) is not of type StreamTransformer<T, dynamic> because _signal.map((_) => true) cannot be typed as Stream<bool> (package:stream_transformers/src/skip_until.dart, line 29, col 29)
severe: [StaticTypeError] Type check failed: new Merge(stream) (Merge<dynamic, dynamic>) is not of type StreamTransformer<T, dynamic> (package:stream_transformers/src/start_with.dart, line 30, col 47)
severe: [StaticTypeError] Type check failed: new FlatMapLatest((isToggled) {if (isToggled) {return _bindStream(onListen: (EventSink<T> sink) {return input.listen(sink.add, onError: sink.addError, onDone: sink.close);});} else {return new Stream.fromIterable([]);}}) (FlatMapLatest<dynamic, dynamic>) is not of type StreamTransformer<bool, dynamic> (package:stream_transformers/src/when.dart, line 33, col 22)
severe: [StaticTypeError] Type check failed: new Scan(new Queue<A>(), appendToQueue) (Scan<dynamic, dynamic>) is not of type StreamTransformer<A, dynamic> (package:stream_transformers/src/zip.dart, line 39, col 35)
severe: [StaticTypeError] Type check failed: new Scan(new Queue<B>(), appendToQueue) (Scan<dynamic, dynamic>) is not of type StreamTransformer<B, dynamic> (package:stream_transformers/src/zip.dart, line 40, col 35)

package:yaml

severe: [AnalyzerMessage] The getter 'isImplicit' is not defined for the class 'Event' (package:yaml/src/loader.dart, line 75, col 32)
severe: [AnalyzerMessage] The getter 'name' is not defined for the class 'Token' (package:yaml/src/parser.dart, line 257, col 47)
severe: [AnalyzerMessage] The getter 'name' is not defined for the class 'Token' (package:yaml/src/parser.dart, line 264, col 22)
severe: [AnalyzerMessage] The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 265, col 19)
severe: [AnalyzerMessage] The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 271, col 19)
severe: [AnalyzerMessage] The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 300, col 16)
severe: [AnalyzerMessage] The getter 'style' is not defined for the class 'Token' (package:yaml/src/parser.dart, line 306, col 32)
severe: [AnalyzerMessage] The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 311, col 16)
severe: [AnalyzerMessage] The getter 'value' is not defined for the class 'Token' (package:yaml/src/parser.dart, line 311, col 42)
severe: [AnalyzerMessage] The getter 'style' is not defined for the class 'Token' (package:yaml/src/parser.dart, line 311, col 55)
severe: [AnalyzerMessage] The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 318, col 16)
severe: [AnalyzerMessage] The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 325, col 16)
severe: [AnalyzerMessage] The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 332, col 16)
severe: [AnalyzerMessage] The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 340, col 16)
severe: [StaticTypeError] Type check failed: new Pair(versionDirective, tagDirectives) (Pair<dynamic, dynamic>) is not of type Pair<VersionDirective, List<TagDirective>> because tagDirectives cannot be typed as List<TagDirective> (package:yaml/src/parser.dart, line 712, col 12)
severe: [AnalyzerMessage] The getter 'style' is not defined for the class 'Token' (package:yaml/src/scanner.dart, line 446, col 56)
severe: [InvalidMethodOverride] Base class introduces an invalid override. The type of MapMixin.containsValue ((dynamic) → bool) is not a subtype of Map<dynamic, dynamic>.containsValue ((Object) → bool). (package:yaml/src/yaml_node_wrapper.dart, line 17, col 22)

There are PRs outstanding for frape and stream_transformers to fix a few more issues. I spot checked yaml - some issues look like type promotion is not working after an is, other issues seem legitimate.

@devoncarew
Copy link
Contributor Author

Also cc @kevmoo; we're working through package: issues with ddc.

@jmesserly
Copy link

I'm happy to take a look at YAML, unless someone else is already.

@kevmoo
Copy link

kevmoo commented Sep 22, 2015

@devoncarew Please put check-boxes in this issue and assign sub-issues to packages.

@devoncarew
Copy link
Contributor Author

(moved to the top)

@jmesserly
Copy link

I think if you put the checkboxes in the first message (by editing it) it will do a neat UI thing showing % complete.

@jmesserly
Copy link

FYI @vsmenon ... we have a problem here in that we are analyzing against the user's SDK, which itself has strong mode errors. For example, one of the YAML errors is caused by containsValue in MapMixin being incompatible (narrows type) with the one in Map (see https://api.dartlang.org/1.12.1/dart-collection/MapMixin/containsValue.html vs https://api.dartlang.org/1.12.1/dart-core/Map/containsValue.html). That said, it might be a DDC bug/missing feature.

@jmesserly
Copy link

the error is:

[error] Base class introduces an invalid override. The type of MapMixin.containsValue ((dynamic) → bool) is not a subtype of Map<dynamic, dynamic>.containsValue ((Object) → bool). (yaml/lib/src/yaml_node_wrapper.dart, line 17, col 22)

@vsmenon
Copy link

vsmenon commented Sep 23, 2015

@jmesserly - the Map issue was fixed by Lasse's SDK change, right?

@jmesserly
Copy link

yes.

@devoncarew
Copy link
Contributor Author

Perhaps ddc should emit a warning if it's analyzing against an sdk that's older than one with some required fixes? Or, bump up the sdk constraint in its pubspec? The 2nd option is simpler but means that users might be running against older versions of ddc w/o realizing it.

@jmesserly
Copy link

Or, bump up the sdk constraint in its pubspec? The 2nd option is simpler but means that users might be running against older versions of ddc w/o realizing it.

yeah we can totally bump the pubspec as soon as we have a dev build. I think that's probably fine, since Pub will show you that you didn't get the latest DDC version.

For what it's worth, we have a way more serious SDK problem at the moment :)
dart-archive/dev_compiler#257

@devoncarew
Copy link
Contributor Author

Some yaml issues fixes; the last remaining ones tracked here: dart-lang/tools#1892.

@devoncarew
Copy link
Contributor Author

Just 23 left! It's down to collection and yaml.

Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<E> (package:collection/equality.dart, line 75, col 31)
Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<E> (package:collection/equality.dart, line 120, col 53)
Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<E> (package:collection/equality.dart, line 205, col 38)
Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<E> (package:collection/equality.dart, line 223, col 38)
Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<K> (package:collection/equality.dart, line 263, col 42)
Type check failed: const DefaultEquality() (DefaultEquality) is not of type Equality<V> (package:collection/equality.dart, line 264, col 44)

The getter 'name' is not defined for the class 'Token' (package:yaml/src/parser.dart, line 257, col 47)
The getter 'name' is not defined for the class 'Token' (package:yaml/src/parser.dart, line 264, col 22)
The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 265, col 19)
The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 271, col 19)
The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 300, col 16)
The getter 'style' is not defined for the class 'Token' (package:yaml/src/parser.dart, line 306, col 32)
The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 311, col 16)
The getter 'value' is not defined for the class 'Token' (package:yaml/src/parser.dart, line 311, col 42)
The getter 'style' is not defined for the class 'Token' (package:yaml/src/parser.dart, line 311, col 55)
The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 318, col 16)
The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 325, col 16)
The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 332, col 16)
The method 'expand' is not defined for the class 'SourceSpan' (package:yaml/src/parser.dart, line 340, col 16)
The getter 'style' is not defined for the class 'Token' (package:yaml/src/scanner.dart, line 446, col 56)
Base class introduces an invalid override. The type of MapMixin.containsValue ((dynamic) → bool) is not a subtype of Map<dynamic, dynamic>.containsValue ((Object) → bool). (package:yaml/src/yaml_node_wrapper.dart, line 17, col 22)

@vsmenon
Copy link

vsmenon commented Sep 28, 2015

Nice! The very last one was already fixed in the SDK (MapMixin.containsValue) - should disappear when running against the next release.

@jmesserly
Copy link

By the way, you probably want to set -l warning ... most DDC warnings will be about issue that are likely to fail at runtime. For example, DownCastComposite catches invalid List<dynamic> to List<T> cats

@devoncarew
Copy link
Contributor Author

most DDC warnings will be about issue that are likely to fail at runtime

Should this be the default then? I wasn't aware of the option, or that you'd most likely want to run with it on. I'm seeing 294 issues w/ that flag in the plugin, up from 24.

@devoncarew
Copy link
Contributor Author

And, thanks for the info - good to know!

@jmesserly
Copy link

Should this be the default then?

yes. I was really surprised it is not...

@devoncarew
Copy link
Contributor Author

Re: https://codereview.chromium.org/1374563004/ - thanks!

jmesserly pushed a commit to dart-archive/dev_compiler that referenced this issue Sep 29, 2015
@devoncarew
Copy link
Contributor Author

Doing some bug triage - the initial investigation is done; this issue largely covered making things strong mode compliant.

nex3 pushed a commit to dart-lang/sdk that referenced this issue Aug 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants