Migrate const_finder tests to be null safe (flutter/engine#37683)
* Bump language version of package:const_finder_fixtures in preparation of running with sound null safety be default. * Fix null safety errors. * Migrate test files to be null safe. * Fix analyzer warnings.
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
{
|
||||
"name": "const_finder_fixtures",
|
||||
"rootUri": "../lib/",
|
||||
"languageVersion": "2.9"
|
||||
"languageVersion": "2.12"
|
||||
},
|
||||
{
|
||||
"name": "const_finder_fixtures_package",
|
||||
"rootUri": "../pkg/",
|
||||
"languageVersion": "2.9"
|
||||
"languageVersion": "2.12"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
|
||||
class Box {
|
||||
const Box(this.content1, this.content2);
|
||||
final Object content1;
|
||||
final Object content2;
|
||||
final Object? content1;
|
||||
final Object? content2;
|
||||
}
|
||||
|
||||
const Box box1_0 = Box(null, null);
|
||||
|
||||
@@ -40,7 +40,7 @@ void main() {
|
||||
}
|
||||
|
||||
class IgnoreMe {
|
||||
const IgnoreMe([this.target]);
|
||||
const IgnoreMe(this.target);
|
||||
|
||||
final Target target;
|
||||
|
||||
@@ -68,7 +68,7 @@ class StaticConstInitializer {
|
||||
void useOne(int index) {
|
||||
targets[index].hit();
|
||||
targetSet.skip(index).first.hit();
|
||||
targetMap[index].hit();
|
||||
targetMap[index]!.hit();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ void main() {
|
||||
}
|
||||
|
||||
class IgnoreMe {
|
||||
const IgnoreMe([this.target]);
|
||||
const IgnoreMe(this.target);
|
||||
|
||||
final Target target;
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ class Target {
|
||||
|
||||
final String stringValue;
|
||||
final int intValue;
|
||||
final Target targetValue;
|
||||
final Target? targetValue;
|
||||
|
||||
void hit() {
|
||||
print('$stringValue $intValue');
|
||||
@@ -15,7 +15,7 @@ class Target {
|
||||
}
|
||||
|
||||
class ExtendsTarget extends Target {
|
||||
const ExtendsTarget(String stringValue, int intValue, Target targetValue)
|
||||
const ExtendsTarget(String stringValue, int intValue, Target? targetValue)
|
||||
: super(stringValue, intValue, targetValue);
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class ImplementsTarget implements Target {
|
||||
@override
|
||||
final int intValue;
|
||||
@override
|
||||
final Target targetValue;
|
||||
final Target? targetValue;
|
||||
|
||||
@override
|
||||
void hit() {
|
||||
|
||||
Reference in New Issue
Block a user