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

Unified Diff: pkg/front_end/lib/src/fasta/source/outline_builder.dart

Issue 2675603002: Reduce strong mode errors and warnings (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: pkg/front_end/lib/src/fasta/source/outline_builder.dart
diff --git a/pkg/front_end/lib/src/fasta/source/outline_builder.dart b/pkg/front_end/lib/src/fasta/source/outline_builder.dart
index 46f5d463236404f4c76d082cba8bb7f45ba55937..42ed2219a0320a0e45df81d4b0a5b8d30e236755 100644
--- a/pkg/front_end/lib/src/fasta/source/outline_builder.dart
+++ b/pkg/front_end/lib/src/fasta/source/outline_builder.dart
@@ -352,14 +352,21 @@ class OutlineBuilder extends UnhandledListener {
@override
void endFormalParameters(int count, Token beginToken, Token endToken) {
debugEvent("FormalParameters");
+ // TODO(sigmund, ahe): to make strong clean we can either cast every value
+ // below, or split this list in 2, and simply ensure that we always have a
+ // list for optional arguments (empty or null there are none):
+ // List<FormalParameterBuilder> optionalFormals = pop();
+ // List<FormalParameterBuilder> requiredFormals = popList(count);
List formals = popList(count);
if (formals != null && formals.isNotEmpty) {
var last = formals.last;
if (last is List) {
+ List<FormalParameterBuilder> l = last;
Siggi Cherem (dart-lang) 2017/02/02 04:26:58 I don't want to submit this, this was just a test
+ List<FormalParameterBuilder> f = formals.sublist(0, formals.length - 1);
var newList =
new List<FormalParameterBuilder>(formals.length - 1 + last.length);
- newList.setRange(0, formals.length - 1, formals);
- newList.setRange(formals.length - 1, newList.length, last);
+ newList.setRange(0, formals.length - 1, f);
+ newList.setRange(formals.length - 1, newList.length, l);
for (int i = 0; i < last.length; i++) {
newList[i + formals.length - 1] = last[i];
}

Powered by Google App Engine
This is Rietveld 408576698