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

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_test.dart

Issue 1963593003: Implement 'instantiate to bounds' feature in resynthesizer. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Fixes for review comments. Created 4 years, 7 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
Index: pkg/analyzer/test/src/task/strong/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index 2465bfd65aae2d82459ec5b4cd27eb0a3afce15a..1807bde5413838cc1418fa8139e116e9d8777187 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -2839,6 +2839,22 @@ A v = null;
expect(unit.topLevelVariables[0].type.toString(), 'A<int>');
}
+ void test_instantiateToBounds_invokeConstructor_noBound() {
+ var unit = checkFile('''
+class C<T> {}
+var x = new C();
+''');
+ expect(unit.topLevelVariables[0].type.toString(), 'C<dynamic>');
+ }
+
+ void test_instantiateToBounds_invokeConstructor_typeArgsExact() {
+ var unit = checkFile('''
+class C<T extends num> {}
+var x = new C<int>();
+''');
+ expect(unit.topLevelVariables[0].type.toString(), 'C<int>');
+ }
+
void test_instantiateToBounds_notGeneric() {
var unit = checkFile(r'''
class A {}

Powered by Google App Engine
This is Rietveld 408576698