Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Migrate const_finder tests to be null safe #37683

Merged
merged 4 commits into from
Nov 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
4 changes: 2 additions & 2 deletions tools/const_finder/test/fixtures/lib/box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions tools/const_finder/test/fixtures/lib/consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void main() {
}

class IgnoreMe {
const IgnoreMe([this.target]);
const IgnoreMe(this.target);

final Target target;

Expand Down Expand Up @@ -68,7 +68,7 @@ class StaticConstInitializer {
void useOne(int index) {
targets[index].hit();
targetSet.skip(index).first.hit();
targetMap[index].hit();
targetMap[index]!.hit();
}
}

Expand Down
2 changes: 1 addition & 1 deletion tools/const_finder/test/fixtures/lib/consts_and_non.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void main() {
}

class IgnoreMe {
const IgnoreMe([this.target]);
const IgnoreMe(this.target);

final Target target;

Expand Down
6 changes: 3 additions & 3 deletions tools/const_finder/test/fixtures/lib/target.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ class Target {

final String stringValue;
final int intValue;
final Target targetValue;
final Target? targetValue;

void hit() {
print('$stringValue $intValue');
}
}

class ExtendsTarget extends Target {
const ExtendsTarget(String stringValue, int intValue, Target targetValue)
const ExtendsTarget(String stringValue, int intValue, Target? targetValue)
: super(stringValue, intValue, targetValue);
}

Expand All @@ -27,7 +27,7 @@ class ImplementsTarget implements Target {
@override
final int intValue;
@override
final Target targetValue;
final Target? targetValue;

@override
void hit() {
Expand Down