Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0073-issue-45400.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)
}
}