Files
swift-mirror/test/SILOptimizer/optimize_keypath_bug.swift
Erik Eckstein 2f124cf564 Remove the -enable-ossa-modules option.
OSSA modules are enabled by default.
The compiler still accepts this option but it has no effect.
2025-09-26 08:01:08 +02:00

31 lines
795 B
Swift

// RUN: %target-swift-frontend -emit-sil -O -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
}