File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
SwiftCompilerSources/Sources/SIL Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -182,8 +182,12 @@ extension Sequence where Element == Operand {
182
182
return self . lazy. map { $0. instruction }
183
183
}
184
184
185
- // This intentinally returns a Sequence of `Instruction` and not a Sequence of `I` to be able to use
186
- // it as argument to `InstructionSet.insert(contentsOf:)`.
185
+ public func users< I: Instruction > ( ofType: I . Type ) -> LazyMapSequence < LazyFilterSequence < Self > , I > {
186
+ self . lazy. filter { $0. instruction is I } . lazy. map { $0. instruction as! I }
187
+ }
188
+
189
+ // This overload which returns a Sequence of `Instruction` and not a Sequence of `I` is used for APIs, like
190
+ // `InstructionSet.insert(contentsOf:)`, which require a sequence of `Instruction`.
187
191
public func users< I: Instruction > ( ofType: I . Type ) -> LazyMapSequence < LazyFilterSequence < Self > , Instruction > {
188
192
self . lazy. filter { $0. instruction is I } . users
189
193
}
You can’t perform that action at this time.
0 commit comments