| Index: pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart
|
| diff --git a/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..c63a8d7ea62a668efd85ad17f208dc2ec4c69476
|
| --- /dev/null
|
| +++ b/pkg/front_end/testcases/inference/downwards_inference_on_list_literals_infer_if_value_types_match_context.dart
|
| @@ -0,0 +1,122 @@
|
| +// 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;
|
| +
|
| +class DartType {}
|
| +
|
| +typedef void Asserter<T>(T type);
|
| +typedef Asserter<T> AsserterBuilder<S, T>(S arg);
|
| +
|
| +Asserter<DartType> _isInt;
|
| +Asserter<DartType> _isString;
|
| +
|
| +abstract class C {
|
| + static AsserterBuilder<List<Asserter<DartType>>, DartType> assertBOf;
|
| + static AsserterBuilder<List<Asserter<DartType>>, DartType> get assertCOf =>
|
| + null;
|
| +
|
| + AsserterBuilder<List<Asserter<DartType>>, DartType> assertAOf;
|
| + AsserterBuilder<List<Asserter<DartType>>, DartType> get assertDOf;
|
| +
|
| + method(AsserterBuilder<List<Asserter<DartType>>, DartType> assertEOf) {
|
| + assertAOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + assertBOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + assertCOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + assertDOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + assertEOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + }
|
| +}
|
| +
|
| +abstract class G<T> {
|
| + AsserterBuilder<List<Asserter<DartType>>, DartType> assertAOf;
|
| + AsserterBuilder<List<Asserter<DartType>>, DartType> get assertDOf;
|
| +
|
| + method(AsserterBuilder<List<Asserter<DartType>>, DartType> assertEOf) {
|
| + assertAOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + this.assertAOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + this.assertDOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + assertEOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + }
|
| +}
|
| +
|
| +AsserterBuilder<List<Asserter<DartType>>, DartType> assertBOf;
|
| +AsserterBuilder<List<Asserter<DartType>>, DartType> get assertCOf => null;
|
| +
|
| +main() {
|
| + AsserterBuilder<List<Asserter<DartType>>, DartType> assertAOf;
|
| + /*@promotedType=none*/ assertAOf(
|
| + /*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + assertBOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + assertCOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + C.assertBOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + C.assertCOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| +
|
| + C c;
|
| + /*@promotedType=none*/ c
|
| + .assertAOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + /*@promotedType=none*/ c
|
| + .assertDOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| +
|
| + G<int> g;
|
| + /*@promotedType=none*/ g
|
| + .assertAOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| + /*@promotedType=none*/ g
|
| + .assertDOf(/*@typeArgs=Asserter<DartType>(DartType type) → void*/ [
|
| + _isInt,
|
| + _isString
|
| + ]);
|
| +}
|
|
|