pointfreeco / swift-custom-dump

A collection of tools for debugging, diffing, and testing your application's data structures.
MIT License
800 stars 89 forks source link

Crash when dumping a key path in release build with Xcode 14 #67

Closed arthuang-ui closed 1 year ago

arthuang-ui commented 1 year ago

Describe the bug Dumping a key path crashes CustomDump. But this only happens in release build that builds on Xcode 14. Our app uses CustomDump to do logging and now it always crashes when there's a BindingAction gets logged. Tried on Xcode 13.4.1 and there's no problem.

To Reproduce Just dump any key paths in release build in Xcode 14. Sample project: https://github.com/jutoart/DumpKeyPath

public struct DumpKeyPath {
  public private(set) var text = "Hello, World!"
  private let keyPath: WritableKeyPath<DumpKeyPath, String> = \.text

  public static func main() {
    customDump(testObject.keyPath) // <-- crash here
  }
}

Screenshots

CleanShot 2022-11-07 at 10 10 53@2x

Environment