Files
swift-mirror/validation-test/compiler_crashers_2_fixed/0082-rdar30354669.swift
John McCall 22382f7e15 Reimplement associated conformance IRGen using Doug's conformance
access path work.

Having done so, simplify archetype TypeInfos by removing a now-
unnecessary layer of abstraction.
2017-03-14 03:48:10 -04:00

31 lines
627 B
Swift

// RUN: %target-swift-frontend -primary-file %s -emit-ir
public func ==<T: EquatableMetaType>(lhs: T, rhs: T) -> Bool {
return type(of: lhs) == type(of: lhs)
}
public protocol EquatableMetaType {
}
class Block : Equatable, EquatableMetaType {
}
extension Array where Element : Block {
func indexByType(of: Element) -> Array.Index? {
let count = self.count
var result: Array.Index = 0
for i in self {
if i == of {
return result
}
if result < count {
result += 1
}
}
return nil
}
}