mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
29 lines
789 B
Swift
29 lines
789 B
Swift
// RUN: %target-swift-frontend %s -emit-ir
|
|
|
|
// https://github.com/apple/swift/issues/45400
|
|
|
|
protocol ViewModel {}
|
|
|
|
protocol ViewModelCell {}
|
|
|
|
protocol CellAwareViewModel : ViewModel {
|
|
associatedtype CellType: ViewModelCell
|
|
}
|
|
|
|
protocol ConfigurableViewModelCell : ViewModelCell {
|
|
associatedtype DataType: CellAwareViewModel
|
|
}
|
|
|
|
func useType<T: ViewModelCell>(cellType: T.Type) {
|
|
}
|
|
|
|
class ConfigurableViewModelCellProvider<V, C> where V: CellAwareViewModel,
|
|
C: ConfigurableViewModelCell,
|
|
C.DataType == V,
|
|
V.CellType == C {
|
|
static func crasher() {
|
|
// IRGen for the metatype instruction
|
|
useType(cellType: C.self)
|
|
}
|
|
}
|