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

Unified Diff: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart

Issue 2954133002: Resolve type parameter bounds when looking up interface members. (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
diff --git a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
index 71f2b30b67e10b0059b217923d1396d2fcd81623..b9bb94889534f760cbcfd36c387d8c6dae59b4f2 100644
--- a/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
+++ b/pkg/front_end/lib/src/fasta/kernel/kernel_shadow_ast.dart
@@ -1952,41 +1952,6 @@ class KernelTypeInferrer extends TypeInferrerImpl {
// everything, this case should no longer be needed.
}
}
-
- /// If the given [type] is a [TypeParameterType], resolve it to its bound.
- DartType resolveTypeParameter(DartType type) {
- DartType resolveOneStep(DartType type) {
- if (type is TypeParameterType) {
- return type.bound;
- } else {
- return null;
- }
- }
-
- var resolved = resolveOneStep(type);
- if (resolved == null) return type;
-
- // Detect circularities using the tortoise-and-hare algorithm.
- type = resolved;
- DartType hare = resolveOneStep(type);
- if (hare == null) return type;
- while (true) {
- if (identical(type, hare)) {
- // We found a circularity. Give up and return `dynamic`.
- return const DynamicType();
- }
-
- // Hare takes two steps
- var step1 = resolveOneStep(hare);
- if (step1 == null) return hare;
- var step2 = resolveOneStep(step1);
- if (step2 == null) return hare;
- hare = step2;
-
- // Tortoise takes one step
- type = resolveOneStep(type);
- }
- }
}
/// Shadow object for [TypeLiteral].
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/type_inference/type_inferrer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698