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

Unified Diff: pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart

Issue 2904133002: Fix type inference of redirecting factory constructor invocations. (Closed)
Patch Set: Created 3 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/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart
diff --git a/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart
new file mode 100644
index 0000000000000000000000000000000000000000..b9337fae1fb7fc31fea25228490b6e08907945e0
--- /dev/null
+++ b/pkg/front_end/testcases/inference/constructors_infer_from_arguments_redirecting_factory_to_factory.dart
@@ -0,0 +1,23 @@
+// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+/*@testedFeatures=inference*/
+library test;
+
+abstract class C<T> {
+ T get t;
+ void set t(T x);
+
+ factory C(T t) = CImpl<T>;
+}
+
+class CImpl<T> implements C<T> {
+ T t;
+ CImpl._(this.t);
+ factory CImpl(T t) => new /*@typeArgs=CImpl::•::T*/ CImpl._(t);
+}
+
+main() {
+ var /*@type=C<int>*/ x = new /*@typeArgs=int*/ C(42);
+}

Powered by Google App Engine
This is Rietveld 408576698