Skip to content

Commit

Permalink
Fixes #984: I-2-b tests updated according to the recent changes for d…
Browse files Browse the repository at this point in the history
  • Loading branch information
iarkh committed Jan 28, 2021
1 parent 73f7c6b commit f35ddce
Show file tree
Hide file tree
Showing 16 changed files with 101 additions and 451 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
* [<U1,m ..., Uk,m>].
* @description Checks that instantiation to bounds works OK for the class with
* [typedef G<X> = X Function(X)] parameter (invariant case).
* @Issue 44786
* @Issue dart-lang/language#1133
* @author iarkh@unipro.ru
*/

Expand All @@ -52,9 +54,8 @@ import "../../../../Utils/expect.dart";
typedef G<X> = X Function(X);
class A<X extends G<A<X>>> {}

typedef expected = A<A<dynamic> Function(A<dynamic>)>;

main() {
Expect.equals(
typeOf<A<G<A<dynamic>>>>(),
typeOf<A>()
);
Expect.equals(expected, A);
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
* [<U1,m ..., Uk,m>].
* @description Checks that instantiation to bounds works OK for [typedef G<X> =
* Function(X)], [class A<X extends G<A<X, Y>>, Y extends X>] (covariant)
* @Issue 44786
* @Issue dart-lang/language#1133
* @author iarkh@unipro.ru
*/

Expand All @@ -52,9 +54,8 @@ import "../../../../Utils/expect.dart";
typedef G<X> = X Function(X);
class A<X extends G<A<X, Y>>, Y extends X> {}

typedef expected = A<A<dynamic, dynamic> Function(A<dynamic, dynamic>), dynamic>;

main() {
Expect.equals(
typeOf<A<G<A<dynamic, dynamic>>, dynamic>>(),
typeOf<A>()
);
Expect.equals(expected, A);
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
* [<U1,m ..., Uk,m>].
* @description Checks that instantiation to bounds works OK for [typedef G<X> =
* X Function(X)], [class A<X extends G<A<X, Y>>, Y extends X>] (invariant)
* @Issue 44786
* @Issue dart-lang/language#1133
* @author iarkh@unipro.ru
*/

Expand All @@ -52,9 +54,9 @@ import "../../../../Utils/expect.dart";
typedef G<X> = X Function(X);
class A<X extends G<A<Y, X>>, Y extends G<A<X, Y>>> {}

typedef expected = A<A<dynamic, dynamic> Function(A<dynamic, dynamic>),
A<dynamic, dynamic> Function(A<dynamic, dynamic>)>;

main() {
Expect.equals(
typeOf<A<G<A<dynamic, dynamic>>,G<A<dynamic, dynamic>>>>(),
typeOf<A>()
);
Expect.equals(expected, A);
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,83 +44,26 @@
* [<U1,m ..., Uk,m>].
* @description Checks that instantiation to bounds works OK for [typedef G<X> =
* Function(X)], [class A<X extends G<A<X, Y>>, Y extends X>] (covariant)
* @Issue 41963, 41964
*
* @Issue 41963, 41964, 44786
* @Issue dart-lang/language#1133
*
* @author iarkh@unipro.ru
*/
import "../../../../Utils/expect.dart";

typedef G<X> = X Function(X);
class A<X extends G<A<X>>> {}

void test(A source) {
var fsource = toF(source);

F<A<G<A<dynamic>>>> target = fsource;

F<A<G<A<Never>>>> target0 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<Null>>>> target1 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<dynamic>> target2 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<dynamic>>> target3 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<G<dynamic>>>>> target4 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<G<A<dynamic>>>>>> target5 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<Never>> target6 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<Never>>> target7 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<G<Never>>>>> target8 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<G<A<Never>>>>>> target9 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<Null>> targe10 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<Null>>> target11 = fsource;
// ^^^^^^^
main() {
A? source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

A();
//^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
* [<U1,m ..., Uk,m>].
* @description Checks that instantiation to bounds works OK for [typedef G<X> =
* X Function(X)], [class A<X extends G<A<X, Y>>, Y extends X>]
*
* @Issue 44786
* @Issue dart-lang/language#1133
*
* @author iarkh@unipro.ru
*/

Expand All @@ -52,54 +56,16 @@ import "../../../../Utils/expect.dart";
typedef G<X> = X Function(X);
class A<X extends G<A<X, Y>>, Y extends X> {}

test(A source) {
var fsource = toF(source);
F<A<G<A<dynamic, dynamic>>, dynamic>> target = fsource;

F<A<dynamic, dynamic>> target1 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<dynamic>, dynamic>> target2 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<G<dynamic>, dynamic>>, dynamic>> target3 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<Never, Never>>, Never>> target4 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<Never, Never>> target5 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<Never>, Never>> target6 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<Never, Never>>, Never>> target7 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<dynamic, Never>>, Never>> target8 = fsource;
// ^^^^^^^
main() {
A? source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

A();
//^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@
* [<U1,m ..., Uk,m>].
* @description Checks that instantiation to bounds works OK for [typedef G<X> =
* X Function(X)], [class A<X extends G<A<Y, X>>, Y extends G<A<X, Y>>>]
* @Issue 41963, 41964
*
* @Issue 41963, 41964, 44786
* @Issue dart-lang/language#1133
*
* @author iarkh@unipro.ru
*/

Expand All @@ -53,83 +56,16 @@ import "../../../../Utils/expect.dart";
typedef G<X> = X Function(X);
class A<X extends G<A<Y, X>>, Y extends G<A<X, Y>>> {}

void test(A source) {
var fsource = toF(source);
F<A<G<A<dynamic, dynamic>>, G<A<dynamic, dynamic>>>> target = fsource;

F<A<dynamic, G<A<dynamic, dynamic>>>> target1 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<dynamic>, G<A<dynamic, dynamic>>>> target2 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<G<dynamic>, dynamic>>, G<A<dynamic, dynamic>>>> target3 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<dynamic, dynamic>>, dynamic>> target4 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<dynamic, dynamic>>, G<dynamic>>> target5 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<Never, Never>>, G<A<Never, Never>>>> target6 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<dynamic, G<A<Never, Never>>>> target7 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<dynamic>, G<A<Never, Never>>>> target8 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
F<A<G<A<G<Never>, Never>>, G<A<Never, Never>>>> target9 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<Never, Never>>, Never>> target10 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<Never, Never>>, G<Never>>> target11 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<Null, Null>>, G<A<Null, Null>>>> target12 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<dynamic, Never>>, G<A<dynamic, Never>>>> target13 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

F<A<G<A<Never, dynamic>>, G<A<Never, dynamic>>>> target14 = fsource;
// ^^^^^^^
main() {
A? source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {
A();
//^
// [analyzer] unspecified
// [cfe] unspecified

}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
* [<U1,m ..., Uk,m>].
* @description Checks that instantiate-to-bounds works correctly for
* [typedef A<X> = X Function(X); typedef G<X extends A<X>> = X Function()]
*
* @Issue 44786
* @Issue dart-lang/language#1133
*
* @author iarkh@unipro.ru
*/

Expand All @@ -52,9 +56,8 @@ import "../../../../Utils/expect.dart";
typedef A<X> = X Function(X);
typedef G<X extends A<X>> = X Function();

typedef expected = dynamic Function(dynamic) Function();

main() {
Expect.equals(
typeOf<G<A<dynamic>>>(),
typeOf<G>()
);
Expect.equals(expected, G);
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
* [<U1,m ..., Uk,m>].
* @description Checks that instantiate-to-bounds works correctly for
* [typedef A<X> = X Function(X); typedef G<X extends A<X>> = X Function()]
*
* @Issue 44786
* @Issue dart-lang/language#1133
*
* @author iarkh@unipro.ru
*/

Expand All @@ -52,9 +56,8 @@ import "../../../../Utils/expect.dart";
typedef A<X> = X Function(X);
typedef G<X extends A<X>> = void Function(X);

typedef expected = void Function(dynamic Function(dynamic));

main() {
Expect.equals(
typeOf<G<A<dynamic>>>(),
typeOf<G>()
);
Expect.equals(expected, G);
}
Loading

0 comments on commit f35ddce

Please sign in to comment.