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_l2_02_* tests updated according to the recent SDK changes.
  • Loading branch information
iarkh committed Oct 6, 2020
1 parent 5455c26 commit 8c531d3
Show file tree
Hide file tree
Showing 20 changed files with 643 additions and 67 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* [<U1,m ..., Uk,m>].
* @description Checks that instantiation to bounds works as expected for
* [class A<X extends A<X>>], [class B<X extends A<A<X>>>]
* @Issue 34726, 34948
* @Issue 34726, 34948, 43687
* @author iarkh@unipro.ru
*/
// SharedOptions=--enable-experiment=non-nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class A<X> {}
typedef G<X extends A<X>, Y extends A<Y>> = void Function<X1 extends X>(Y);

test(G source) {
void Function<X extends A<dynamic>>(A<Never>) target1 = source;
void Function<X extends A<dynamic>>(Never) target1 = source;

void Function<X extends A<dynamic>>(A<dynamic>) target2 = source;
// ^^^^^^
Expand All @@ -71,6 +71,28 @@ test(G source) {
void Function<X extends A<Never>>(A<Never>) target4 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

void Function<X extends A<dynamic>>(A<Never>) target5 = source;

void Function<X extends A<dynamic>>(dynamic) target6 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

void Function<X extends A<dynamic>>(Null) target7 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

void Function<X extends dynamic>(Never) target8 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

void Function<X extends Never>(Never) target9 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,60 @@
*/
// SharedOptions=--enable-experiment=non-nullable

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

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

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

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

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

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

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

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

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

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

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

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

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

main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -55,40 +55,55 @@ import "../../../../Utils/expect.dart";
class A<X> {}
typedef G<X extends A<X>, Y extends X> = Y Function(X);

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

F<G<A<Never>, A<Never>>?>? target = fsource;
F<G<A<Never>, A<Never>>> target = fsource;

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

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

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

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

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

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

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

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

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

main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,60 @@
*/
// SharedOptions=--enable-experiment=non-nullable

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

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

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

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

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

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

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

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

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

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

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

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

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

main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,38 @@ class A<X> {}
typedef G<X extends A<X>, Y extends X> =
void Function<X1 extends X, Y1 extends Y>();

main() {
G? source;
// ^^^^^^
test(G source) {
void Function<X extends A<dynamic>, Y extends A<dynamic>>() target1 = source;

void Function<X extends A<dynamic>, Y extends A<Never>>() target2 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

void Function<X extends A<Never>, Y extends A<dynamic>>() target3 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

void Function<X extends A<Never>, Y extends A<Never>>() target4 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

void Function<X extends A<dynamic>, Y extends A<Null>>() target5 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

void Function<X extends A<Null>, Y extends A<dynamic>>() target6 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

void Function<X extends A<Null>, Y extends A<Null>>() target7 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,20 @@ class A<X> {}
typedef G<X extends A<X>, Y extends X> =
void Function<X1 extends X, Y1 extends Y>(X, Y);

main() {
G? source;
// ^^^^^^
test(G source) {
void Function<X extends A<dynamic>, Y extends A<dynamic>>(A<dynamic>, A<dynamic>) target1 = source;

void Function<X extends A<dynamic>, Y extends A<dynamic>>(A<Never>, A<Never>) target2 = source;

void Function<X extends A<Never>, Y extends A<Never>>(A<dynamic>, A<dynamic>) target3 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

void Function<X extends A<Never>, Y extends A<Never>>(A<Never>, A<Never>) target4 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,20 @@ class A<X> {}
typedef G<X extends A<X>, Y extends X> =
void Function<X1 extends X, Y1 extends Y>(X);

main() {
G? source;
// ^^^^^^
test(G source) {
void Function<X extends A<dynamic>, Y extends A<dynamic>>(A<dynamic>) target1 = source;

void Function<X extends A<dynamic>, Y extends A<dynamic>>(A<Never>) target2 = source;

void Function<X extends A<Never>, Y extends A<Never>>(A<dynamic>) target3 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

void Function<X extends A<Never>, Y extends A<Never>>(A<Never>) target4 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,20 @@ class A<X> {}
typedef G<X extends A<X>, Y extends X> =
void Function<X1 extends X, Y1 extends Y>(Y);

main() {
G? source; //# 01: compile-time error
test(G source) {
void Function<X extends A<dynamic>, Y extends A<dynamic>>(A<dynamic>) target1 = source;

void Function<X extends A<dynamic>, Y extends A<dynamic>>(A<Never>) target2 = source;

void Function<X extends A<Never>, Y extends A<Never>>(A<dynamic>) target3 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified

void Function<X extends A<Never>, Y extends A<Never>>(A<Never>) target4 = source;
// ^^^^^^
// [analyzer] unspecified
// [cfe] unspecified
}

main() {}
Loading

0 comments on commit 8c531d3

Please sign in to comment.