Skip to content

Commit 51ec4e9

Browse files
committed
helpful context
1 parent 434ce44 commit 51ec4e9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkgs/test_core/lib/src/runner/coverage.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,10 @@ Future<Coverage> writeCoverage(
3131
await out.close();
3232
}
3333
return switch (coverage['coverage']) {
34-
List<dynamic> hitMapJson? => HitMap.parseJson(
34+
// Matching on `List<dynamic>` the runtime type of `List` in JSON is
35+
// never `Map<String, dynamic>`. The `cast` below ensures the runtime type
36+
// is correct for `HitMap.parseJson`.
37+
List<dynamic> hitMapJson => HitMap.parseJson(
3538
hitMapJson.cast<Map<String, dynamic>>(),
3639
),
3740
null => const {},

0 commit comments

Comments
 (0)