Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide more debugging info when a snapshot gets set multiple times #417

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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