mirror of
https://github.com/apple/swift.git
synced 2026-10-18 17:49:23 +02:00
When enabled, we skip enumerateDirectSupertypes(). I'd like to get it enabled unconditionally, since it blocks further binding optimizations. The new enumerate_supertypes.swift file collects examples which no longer type check with this feature enabled. For now, this is off by default.
34 lines
1.2 KiB
Swift
34 lines
1.2 KiB
Swift
// RUN: %target-swift-frontend -emit-sil -O -sil-verify-all -solver-disable-enumerate-supertypes %s
|
|
// RUN: %target-swift-frontend -emit-sil -O -sil-verify-all -solver-disable-enumerate-supertypes -enable-sil-opaque-values %s
|
|
// RUN: %target-swift-frontend -emit-sil -O -sil-verify-all -solver-enable-enumerate-supertypes %s
|
|
// RUN: %target-swift-frontend -emit-sil -O -sil-verify-all -solver-enable-enumerate-supertypes -enable-sil-opaque-values %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
|
|
}
|
|
|