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> {