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

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

Issue 2363503003: fix #27411, avoid capture for instance creation (Closed)
Patch Set: Created 4 years, 3 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 e9ccb34409b82abedc96faa0e90078f62631f8f5..5330372520bb889325d1b7b112a14761e39083e7 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -700,6 +700,17 @@ main() {
expect(unit.topLevelVariables[0].type.toString(), 'C<int>');
}
+ void test_constructors_inferFromArguments_factory_callsConstructor() {
+ checkFile(r'''
+class A<T> {
+ A<T> f = /*info:INFERRED_TYPE_ALLOCATION*/new A();
+ A();
+ factory A.factory() => /*info:INFERRED_TYPE_ALLOCATION*/new A();
+ A<T> m() => /*info:INFERRED_TYPE_ALLOCATION*/new A();
+}
+ ''');
+ }
+
void test_constructors_inferFromArguments_named() {
var unit = checkFile('''
class C<T> {

Powered by Google App Engine
This is Rietveld 408576698