Skip to content

Commit

Permalink
Fixes #946: LanguageFeatures/Instantiate-to-bounds/typedef-static/typ…
Browse files Browse the repository at this point in the history
…edef_typedef_* tests updated according to the recent SDK changes.
  • Loading branch information
iarkh committed Oct 8, 2020
1 parent bb3f13a commit ef82dd7
Show file tree
Hide file tree
Showing 23 changed files with 578 additions and 214 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ import "../../../../Utils/expect.dart";
typedef A<X> = X Function(X);
typedef G<X extends A<X>> = X Function();

typedef B = dynamic Function(dynamic);
typedef G_expected = B Function();

main() {
Expect.equals(G_expected, G);
Expect.equals(
typeOf<G<A<dynamic>>>(),
typeOf<G>()
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ import "../../../../Utils/expect.dart";
typedef A<X> = X Function(X);
typedef G<X extends A<X>> = void Function(X);

typedef B = dynamic Function(dynamic);
typedef G_expected = void Function(B);

main() {
Expect.equals(G_expected, G);
Expect.equals(
typeOf<G<A<dynamic>>>(),
typeOf<G>()
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ import "../../../../Utils/expect.dart";
typedef A<X> = X Function(X);
typedef G<X extends A<X>> = X Function(X);

typedef B = dynamic Function(dynamic);
typedef G_expected = B Function(B);

main() {
Expect.equals(G_expected, G);
Expect.equals(
typeOf<G<A<dynamic>>>(),
typeOf<G>()
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
* 3. Otherwise, (when no dependencies exist) terminate with the result
* [<U1,m ..., Uk,m>].
* @description Checks that instantiate-to-bounds works correctly for
* [typedef A<X> = void Function(X);
* typedef G<X extends A<X>> = void Function()]
* typedef A<X> = void Function(X); typedef G<X extends A<X>> = void Function()
* @author iarkh@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable
Expand All @@ -56,7 +55,7 @@ typedef G<X extends A<X>> = void Function();

main() {
Expect.equals(
typeOf<G<A<Never>>>(),
typeOf<G<A<dynamic>>>(),
typeOf<G>()
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* 3. Otherwise, (when no dependencies exist) terminate with the result
* [<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>> = void Function()]
* typedef A<X> = X Function(X); typedef G<X extends A<X>> = void Function()
* @author iarkh@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* 3. Otherwise, (when no dependencies exist) terminate with the result
* [<U1,m ..., Uk,m>].
* @description Checks that instantiate-to-bounds works correctly for
* [typedef A<X> = void Function(); typedef G<X extends A<X>> = void Function()]
* typedef A<X> = void Function(); typedef G<X extends A<X>> = void Function()
* @author iarkh@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,77 +43,78 @@
* 3. Otherwise, (when no dependencies exist) terminate with the result
* [<U1,m ..., Uk,m>].
* @description Checks that instantiate-to-bounds works correctly for
* [typedef A<X> = void Function(X);
* typedef A<X> = void Function(X);
* typedef G<X extends A<X>> = X Function()
* @Issue 34689
* typedef G<X extends A<X>> = void Function(X)]
* @author iarkh@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable

import "../../../../Utils/expect.dart";

typedef A<X> = void Function(X);
typedef G<X extends A<X>> = Function(X);
typedef G<X extends A<X>> = X Function();

main() {
G? source;
void test(G source) {
var fsource = toF(source);

F<G<A<Never>>?>? target = fsource;
/*
F<G<A<Null>>?>? target1 = fsource;
// ^^^^^^^
F<G<A<Never>>> target = fsource;

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

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

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

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

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

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

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

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

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

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

F<G<A<A<A<A<Null>>>>>?>? target11 = fsource;
// ^^^^^^^
F<G<A<A<A<A<Null>>>>>> target11 = fsource;
// ^^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
*/
}

main() {}

Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,79 @@
* 3. Otherwise, (when no dependencies exist) terminate with the result
* [<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(X)]
* [typedef A<X> = X Function(X); typedef G<X extends A<X>> = X Function()]
*
* @Issue 41963, 41964
*
* @author iarkh@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable

import "../../../../Utils/expect.dart";

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

main() {
G? source;
// ^^^^^^
void test(G source) {
var fsource = toF(source);

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

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

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

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

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

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

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

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

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

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

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

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

main() {}

Original file line number Diff line number Diff line change
Expand Up @@ -53,44 +53,17 @@ import "../../../../Utils/expect.dart";
typedef A<X> = void Function();
typedef G<X extends A<X>> = X Function();

main() {
G? source;
void test(G source) {
var fsource = toF(source);

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

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

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

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

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

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

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

F<G<A<dynamic>>> target = fsource;
F<G<A<Never>>> target1 = fsource;
F<G<A<Null>>> target2 = fsource;
F<G<A<A<dynamic>>>> target3 = fsource;
F<G<A<A<A<dynamic>>>>> target4 = fsource;
F<G<A<A<Never>>>> target6 = fsource;
F<G<A<A<A<Never>>>>> target7 = fsource;
F<G<A<A<A<A<Never>>>>>> target8 = fsource;
}

main() {}
Loading

0 comments on commit ef82dd7

Please sign in to comment.