From e9a72d5b56ca53c0c2430ff755865ccc7af78d6d Mon Sep 17 00:00:00 2001 From: Bert Date: Tue, 16 Jan 2024 09:25:43 +0100 Subject: [PATCH] add JsonConstructorAttribute to `internal Method()` constructor --- src/coverlet.core/CoverageResult.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/coverlet.core/CoverageResult.cs b/src/coverlet.core/CoverageResult.cs index e2276493a..3cc9ce084 100644 --- a/src/coverlet.core/CoverageResult.cs +++ b/src/coverlet.core/CoverageResult.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Linq; +using System.Text.Json.Serialization; using Coverlet.Core.Enums; using Coverlet.Core.Instrumentation; @@ -22,11 +23,13 @@ internal class Branches : List { } internal class Method { + [JsonConstructor] internal Method() { - Lines = new Lines(); - Branches = new Branches(); + Lines = []; + Branches = []; } + public Lines Lines; public Branches Branches; }