06223ff9f0
Part of https://github.com/dart-lang/sdk/issues/55954 Change-Id: Ie22ff9ddf50f47e20b1cfbf11f01bdc900123619 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/388003 Reviewed-by: Johnni Winther <johnniwinther@google.com> Commit-Queue: Chloe Stefantsova <cstefantsova@google.com>
111 lines
1.8 KiB
Dart
111 lines
1.8 KiB
Dart
test1(List list, bool Function(dynamic) p, int? a) {
|
|
return {
|
|
for (var element in list)
|
|
if (p(element))
|
|
?a
|
|
};
|
|
}
|
|
|
|
test2(List list, bool Function(dynamic) p, int? a, int? b) {
|
|
return {
|
|
for (var element in list)
|
|
if (p(element))
|
|
?a
|
|
else
|
|
?b
|
|
};
|
|
}
|
|
|
|
test3(List list, bool t, int? a) {
|
|
return {
|
|
if (t)
|
|
for (var element in list)
|
|
?a
|
|
};
|
|
}
|
|
|
|
test4(List list, bool t, int? a, int? b) {
|
|
return {
|
|
if (t)
|
|
for (var element in list)
|
|
?a
|
|
else
|
|
for (var element in list)
|
|
?b
|
|
};
|
|
}
|
|
|
|
test5(List list, bool Function(dynamic) p, int? a) {
|
|
return {
|
|
for (var element in list)
|
|
if (p(element))
|
|
?a: "value"
|
|
};
|
|
}
|
|
|
|
test6(List list, bool Function(dynamic) p, int? a, int? b) {
|
|
return {
|
|
for (var element in list)
|
|
if (p(element))
|
|
?a: "value"
|
|
else
|
|
?b: "value"
|
|
};
|
|
}
|
|
|
|
test7(List list, bool t, int? a) {
|
|
return {
|
|
if (t)
|
|
for (var element in list)
|
|
?a: "value"
|
|
};
|
|
}
|
|
|
|
test8(List list, bool t, int? a, int? b) {
|
|
return {
|
|
if (t)
|
|
for (var element in list)
|
|
?a: "value"
|
|
else
|
|
for (var element in list)
|
|
?b: "value"
|
|
};
|
|
}
|
|
|
|
test9(List list, bool Function(dynamic) p, int? a) {
|
|
return {
|
|
for (var element in list)
|
|
if (p(element))
|
|
"key": ?a
|
|
};
|
|
}
|
|
|
|
test10(List list, bool Function(dynamic) p, int? a, int? b) {
|
|
return {
|
|
for (var element in list)
|
|
if (p(element))
|
|
"key": ?a
|
|
else
|
|
"key": ?b
|
|
};
|
|
}
|
|
|
|
test11(List list, bool t, int? a) {
|
|
return {
|
|
if (t)
|
|
for (var element in list)
|
|
"key": ?a
|
|
};
|
|
}
|
|
|
|
test12(List list, bool t, int? a, int? b) {
|
|
return {
|
|
if (t)
|
|
for (var element in list)
|
|
"key": ?a
|
|
else
|
|
for (var element in list)
|
|
"key": ?b
|
|
};
|
|
}
|