Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 47555a2

Browse files
peter-ahe-googlecommit-bot@chromium.org
authored and
commit-bot@chromium.org
committed
Fix detection of implicit bounds
Change-Id: I5fa2ae94f23f5452cdc5f5afe4360ce879c23082 Reviewed-on: https://dart-review.googlesource.com/c/94282 Reviewed-by: Dmitry Stefantsov <dmitryas@google.com>
1 parent eb19bba commit 47555a2

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pkg/front_end/tool/_fasta/bench_maker.dart

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,17 @@ class BenchMaker implements DartTypeVisitor1<void, StringBuffer> {
8888

8989
void writeTypeParameter(TypeParameter parameter, StringBuffer sb) {
9090
sb.write(computeName(parameter));
91-
if (parameter.defaultType is! DynamicType ||
92-
parameter.bound is DynamicType) {
91+
DartType bound = parameter.bound;
92+
DartType defaultType = parameter.defaultType;
93+
bool hasExplicitBound = true;
94+
if (bound is InterfaceType && defaultType is DynamicType) {
95+
if (bound.classNode.supertype == null) {
96+
hasExplicitBound = false;
97+
}
98+
}
99+
if (hasExplicitBound) {
93100
sb.write(" extends ");
94-
parameter.bound.accept1(this, sb);
101+
bound.accept1(this, sb);
95102
}
96103
}
97104

0 commit comments

Comments
 (0)