mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
AST: add the possibility to compare SubstitutionMaps
This commit is contained in:
@@ -24,11 +24,11 @@ public struct SubstitutionMap: CustomStringConvertible, NoReflectionChildren {
|
||||
public init(bridged: BridgedSubstitutionMap) {
|
||||
self.bridged = bridged
|
||||
}
|
||||
|
||||
|
||||
public init() {
|
||||
self.bridged = BridgedSubstitutionMap()
|
||||
}
|
||||
|
||||
|
||||
public init(genericSignature: GenericSignature, replacementTypes: [Type]) {
|
||||
let bridgedReplTypes = replacementTypes.map { $0.bridged }
|
||||
self.bridged = bridgedReplTypes.withBridgedArrayRef {
|
||||
@@ -73,4 +73,8 @@ public struct SubstitutionMap: CustomStringConvertible, NoReflectionChildren {
|
||||
assert(replacementTypes.count == 1)
|
||||
return replacementTypes[0]
|
||||
}
|
||||
|
||||
public static func ==(lhs: SubstitutionMap, rhs: SubstitutionMap) -> Bool {
|
||||
lhs.bridged.isEqualTo(rhs.bridged)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user