Skip to content

Commit e9a72d5

Browse files
committed
add JsonConstructorAttribute to internal Method() constructor
1 parent 59b0f9d commit e9a72d5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/coverlet.core/CoverageResult.cs

+5-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
using System.Collections.Generic;
55
using System.Linq;
6+
using System.Text.Json.Serialization;
67
using Coverlet.Core.Enums;
78
using Coverlet.Core.Instrumentation;
89

@@ -22,11 +23,13 @@ internal class Branches : List<BranchInfo> { }
2223

2324
internal class Method
2425
{
26+
[JsonConstructor]
2527
internal Method()
2628
{
27-
Lines = new Lines();
28-
Branches = new Branches();
29+
Lines = [];
30+
Branches = [];
2931
}
32+
3033
public Lines Lines;
3134
public Branches Branches;
3235
}

0 commit comments

Comments
 (0)