Ran into an interesting issue with non-copyable types tonight. In certain situations I fatal error in a deinit. (Basically when I have not correctly closed a resource before deinit is called). I've simplified the code down to:
struct Example: ~Copyable {
private var failureString: String { "Goodbye." }
public init() { }
deinit { fatalError("FATAL ERROR: \(failureString)") }
}
which fails to compile (under Xcode 15 b8) yielding this error message:
Usage of a noncopyable type that compiler can't verify. This is a compiler bug. Please file a bug with a small example of the bug
Looking for a work around at the moment. Am I not supposed to be accessing computed vars during deinits on non-copyables? This works just fine as a final class.