mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
KeyPathProjector creates alloc_stack and dealloc_stack for temporaries. Insertion of new dealloc_stack can modify stack discipline. Invalidate stack nesting so that it can be fixed up in the pass.
31 lines
817 B
Swift
31 lines
817 B
Swift
// RUN: %target-swift-frontend -emit-sil -O -enable-ossa-modules -sil-verify-all %s
|
|
// REQUIRES: OS=macosx
|
|
|
|
import Foundation
|
|
|
|
// Check the following test does not crash with incorrect stack order
|
|
open class DateFormatter {
|
|
typealias CFType = CFDateFormatter
|
|
open func copy(with zone: NSZone? = nil) -> Any {
|
|
let copied = DateFormatter()
|
|
|
|
func __copy<T>(_ keyPath: ReferenceWritableKeyPath<DateFormatter, T>) {
|
|
copied[keyPath: keyPath] = self[keyPath: keyPath]
|
|
}
|
|
|
|
__copy(\.formattingContext)
|
|
return copied
|
|
}
|
|
|
|
public enum Context : Int {
|
|
case unknown
|
|
case dynamic
|
|
case standalone
|
|
case listItem
|
|
case beginningOfSentence
|
|
case middleOfSentence
|
|
}
|
|
open var formattingContext: Context = .unknown
|
|
}
|
|
|