-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: correctly handle mapping to read-only target arrays (#1562)
- Loading branch information
Showing
4 changed files
with
43 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...EnumerableExistingTargetTest.MapArrayToReadOnlyArrayShouldDiagnostic#Mapper.g.verified.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//HintName: Mapper.g.cs | ||
// <auto-generated /> | ||
#nullable enable | ||
public partial class Mapper | ||
{ | ||
[global::System.CodeDom.Compiler.GeneratedCode("Riok.Mapperly", "0.0.1.0")] | ||
private partial global::B Map(global::A source) | ||
{ | ||
var target = new global::B(); | ||
target.IntValue = source.IntValue; | ||
return target; | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...apshots/EnumerableExistingTargetTest.MapArrayToReadOnlyArrayShouldDiagnostic.verified.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
Diagnostics: [ | ||
{ | ||
Id: RMG083, | ||
Title: Cannot map to read only type, | ||
Severity: Info, | ||
WarningLevel: 1, | ||
Location: : (11,4)-(11,36), | ||
MessageFormat: Cannot map to read-only type {0}, | ||
Message: Cannot map to read-only type int[], | ||
Category: Mapper | ||
} | ||
] | ||
} |
55e3691
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'SourceGeneratorBenchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
3
.Riok.Mapperly.Benchmarks.SourceGeneratorBenchmarks.Compile
2112441.565
ns (± 176879.59315719226
)120741.05671574519
ns (± 1678.1529391966976
)17.50
Riok.Mapperly.Benchmarks.SourceGeneratorBenchmarks.LargeCompile
47027562.26060606
ns (± 599948.1403286234
)1277208.939174107
ns (± 7926.104374412328
)36.82
This comment was automatically generated by workflow using github-action-benchmark.