Skip to content

Commit 14cb25d

Browse files
liamappelbecommit-bot@chromium.org
authored andcommitted
[vm] Fix function type testing in NNBD legacy mode.
This fixes co19_2/Language/Generics/typedef_A04_t06 in legacy mode. Note: There's still an underlying issue that we'll probably run into when switching to strong mode: #40258 Bug: #40171 Change-Id: I335addf887dabdb0ae96aca95f187974dac50215 Fixes: #40171 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132702 Commit-Queue: Liam Appelbe <[email protected]> Reviewed-by: Alexander Markov <[email protected]>
1 parent 420c958 commit 14cb25d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

runtime/vm/object.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7439,7 +7439,10 @@ bool Function::HasSameTypeParametersAndBounds(const Function& other) const {
74397439
ASSERT(bound.IsFinalized());
74407440
other_bound = other_type_param.bound();
74417441
ASSERT(other_bound.IsFinalized());
7442-
if (!bound.Equals(other_bound)) {
7442+
// TODO(dartbug.com/40259): Treat top types as equivalent and disregard
7443+
// nullability in weak mode.
7444+
const bool syntactically = !FLAG_strong_non_nullable_type_checks;
7445+
if (!bound.IsEquivalent(other_bound, syntactically)) {
74437446
return false;
74447447
}
74457448
}

0 commit comments

Comments
 (0)