| commit | 1a2dee516a2995b6974f722ae9e8bc4fdc80046c | [log] [tgz] |
|---|---|---|
| author | Ilya Yanok <yanok@google.com> | Wed Jan 11 06:43:39 2023 +0000 |
| committer | Commit Queue <dart-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Jan 11 06:43:39 2023 +0000 |
| tree | 0173222d3c333f4a77a94dcfcde58ed98a0fb596 | |
| parent | 155398b6dd163148d63fc62c549ccb1f0754e3f8 [diff] |
nnbd_migration: save instantiated bounds correctly Don't save instantiated bounds as generic ones, otherwise the next time they are accessed they could be the wrong ones. Fixes: https://github.com/dart-lang/sdk/issues/50958 Change-Id: Ie10a17f5ad12a05efc954622b9c7f74264f22207 Bug: https://github.com/dart-lang/sdk/issues/50958 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/278750 Commit-Queue: Ilya Yanok <yanok@google.com> Reviewed-by: Paul Berry <paulberry@google.com>
diff --git a/pkg/nnbd_migration/lib/src/decorated_type.dart b/pkg/nnbd_migration/lib/src/decorated_type.dart index 33a8fb8..9fd156d 100644 --- a/pkg/nnbd_migration/lib/src/decorated_type.dart +++ b/pkg/nnbd_migration/lib/src/decorated_type.dart
@@ -430,7 +430,7 @@ assert(oldDecoratedBound == newDecoratedBound); } else { DecoratedTypeParameterBounds.current! - .put(typeFormal, newDecoratedBound); + .put(undecoratedResult.typeFormals[i], newDecoratedBound); } } }
diff --git a/pkg/nnbd_migration/test/api_test.dart b/pkg/nnbd_migration/test/api_test.dart index 771ec96..8c78c72 100644 --- a/pkg/nnbd_migration/test/api_test.dart +++ b/pkg/nnbd_migration/test/api_test.dart
@@ -4904,7 +4904,6 @@ await _checkSingleFileChanges(content, expected); } - @FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/50958') Future<void> test_generic_bound() async { var content = ''' abstract class C<T> {