Files
swift-mirror/test/SILOptimizer/optimize_keypath_bug.swift
Slava Pestov 02fbe2c61d Sema: Introduce -solver-{enable,disable}-enumerate-supertypes flag
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.
2026-06-29 19:07:35 -04:00

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
}