Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: pkg/front_end/lib/src/fasta/loader.dart

Issue 2675603002: Reduce strong mode errors and warnings (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library fasta.loader; 5 library fasta.loader;
6 6
7 import 'dart:async' show 7 import 'dart:async' show
8 Future; 8 Future;
9 9
10 import 'dart:collection' show 10 import 'dart:collection' show
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 // TODO(ahe): Share this message with [buildBodies]. Also make it easy to 105 // TODO(ahe): Share this message with [buildBodies]. Also make it easy to
106 // tell the difference between outlines read from a dill file or source 106 // tell the difference between outlines read from a dill file or source
107 // files. Currently, [libraryCount] is wrong for dill files. 107 // files. Currently, [libraryCount] is wrong for dill files.
108 print(""" 108 print("""
109 $sinceStart: $message ($byteCount bytes) in ${format(ms, 3, 0)}ms, that is, 109 $sinceStart: $message ($byteCount bytes) in ${format(ms, 3, 0)}ms, that is,
110 ${format(byteCount / ms, 3, 12)} bytes/ms, and 110 ${format(byteCount / ms, 3, 12)} bytes/ms, and
111 ${format(ms / libraryCount, 3, 12)} ms/compilation unit."""); 111 ${format(ms / libraryCount, 3, 12)} ms/compilation unit.""");
112 }); 112 });
113 } 113 }
114 114
115 Future<Null> buildOutline(LibraryBuilder library); 115 Future<Null> buildOutline(covariant LibraryBuilder library);
116 116
117 Future<Null> buildBody(LibraryBuilder library, AstKind astKind); 117 Future<Null> buildBody(covariant LibraryBuilder library, AstKind astKind);
118 118
119 List<InputError> collectCompileTimeErrors() { 119 List<InputError> collectCompileTimeErrors() {
120 List<InputError> errors = <InputError>[]; 120 List<InputError> errors = <InputError>[];
121 for (LibraryBuilder library in builders.values) { 121 for (LibraryBuilder library in builders.values) {
122 if (library.loader == this) { 122 if (library.loader == this) {
123 errors.addAll(library.compileTimeErrors); 123 errors.addAll(library.compileTimeErrors);
124 } 124 }
125 } 125 }
126 return errors; 126 return errors;
127 } 127 }
128 } 128 }
129 129
130 String format(double d, int fractionDigits, int width) { 130 String format(double d, int fractionDigits, int width) {
131 return d.toStringAsFixed(fractionDigits).padLeft(width); 131 return d.toStringAsFixed(fractionDigits).padLeft(width);
132 } 132 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698