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

Unified Diff: pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart

Issue 2970273004: Deprecate all diagnostics methods that use strings. (Closed)
Patch Set: Merged with 4df146dd9a465d63344330bf3e45524b927c92ec Created 3 years, 5 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/type_inference/type_inferrer.dart
diff --git a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
index 16794cd6f9c9e8485fe6c437470a80bf7df0f728..84269fea839dbeee1dc76262e5111fcce5bd6232 100644
--- a/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
+++ b/pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart
@@ -3,7 +3,8 @@
// BSD-style license that can be found in the LICENSE.md file.
import 'package:front_end/src/base/instrumentation.dart';
-import 'package:front_end/src/fasta/errors.dart' show internalError;
+import 'package:front_end/src/fasta/deprecated_problems.dart'
+ show deprecated_internalProblem;
import 'package:front_end/src/fasta/kernel/kernel_shadow_ast.dart';
import 'package:front_end/src/fasta/names.dart' show callName;
import 'package:front_end/src/fasta/type_inference/type_inference_engine.dart';
@@ -368,7 +369,7 @@ abstract class TypeInferrerImpl extends TypeInferrer {
}
return interfaceMember;
} else {
- throw internalError(
+ throw deprecated_internalProblem(
'Unexpected invocation type: ${methodInvocation.runtimeType}');
}
}
@@ -396,7 +397,7 @@ abstract class TypeInferrerImpl extends TypeInferrer {
}
return interfaceMember;
} else {
- throw internalError(
+ throw deprecated_internalProblem(
'Unexpected propertyGet type: ${propertyGet.runtimeType}');
}
}
@@ -422,7 +423,7 @@ abstract class TypeInferrerImpl extends TypeInferrer {
}
return interfaceMember;
} else {
- throw internalError(
+ throw deprecated_internalProblem(
'Unexpected propertySet type: ${propertySet.runtimeType}');
}
}
@@ -752,9 +753,9 @@ abstract class TypeInferrerImpl extends TypeInferrer {
// If the match is not successful because `K` is `_`, let all `Si`, all
// `Qi`, and `N` all be `_`.
- // If the match is not successful for any other reason, this will result in
- // a type error, so the implementation is free to choose the best error
- // recovery path.
+ // If the match is not successful for any other reason, this will result
+ // in a type error, so the implementation is free to choose the best
+ // error recovery path.
substitution = Substitution.empty;
}
@@ -794,11 +795,11 @@ abstract class TypeInferrerImpl extends TypeInferrer {
this.closureContext = closureContext;
inferStatement(function.body);
- // If the closure is declared with `async*` or `sync*`, let `M` be the least
- // upper bound of the types of the `yield` expressions in `B’`, or `void` if
- // `B’` contains no `yield` expressions. Otherwise, let `M` be the least
- // upper bound of the types of the `return` expressions in `B’`, or `void`
- // if `B’` contains no `return` expressions.
+ // If the closure is declared with `async*` or `sync*`, let `M` be the
+ // least upper bound of the types of the `yield` expressions in `B’`, or
+ // `void` if `B’` contains no `yield` expressions. Otherwise, let `M` be
+ // the least upper bound of the types of the `return` expressions in `B’`,
+ // or `void` if `B’` contains no `return` expressions.
DartType inferredReturnType;
if (needToSetReturnType || typeNeeded) {
inferredReturnType =

Powered by Google App Engine
This is Rietveld 408576698