Skip to content

Commit

Permalink
Provide more debugging info when a snapshot gets set multiple times (…
Browse files Browse the repository at this point in the history
…improve #370).
  • Loading branch information
nedtwigg committed Jun 3, 2024
1 parent fb49674 commit d49431b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions jvm/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Bump Kotlin to 2.0.0. ([#405](https://github.com/diffplug/selfie/pull/405))
### Fixed
- Do not remove stale snapshot files when readonly is true. ([#367](https://github.com/diffplug/selfie/pull/367))
- Provide more debugging info when a snapshot gets set multiple times. (helps with [#370](https://github.com/diffplug/selfie/issues/370))

## [2.0.2] - 2024-03-20
### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ sealed class WriteTracker<K : Comparable<K>, V> {
}
if (existing.snapshot != snapshot) {
throw layout.fs.assertFailed(
"Snapshot was set to multiple values!\n first time: ${existing.callStack.location.ideLink(layout)}\n this time: ${call.location.ideLink(layout)}\n$howToFix",
"Snapshot was set to multiple values!\n" +
" first value: ${existing.snapshot}\n" +
" this time: ${snapshot}\n" +
" first call: ${existing.callStack.ideLink(layout)}\n" +
" this call: ${call.ideLink(layout)}\n" +
"$howToFix",
existing.snapshot,
snapshot)
} else if (!layout.allowMultipleEquivalentWritesToOneLocation) {
Expand Down

0 comments on commit d49431b

Please sign in to comment.