File tree Expand file tree Collapse file tree 2 files changed +5
-21
lines changed
swift/ql/lib/codeql/swift Expand file tree Collapse file tree 2 files changed +5
-21
lines changed Original file line number Diff line number Diff line change @@ -192,7 +192,11 @@ private module Cached {
192192 )
193193 or
194194 // flow from Pattern to an identity-preserving sub-Pattern:
195- nodeFrom .asPattern ( ) = nodeTo .asPattern ( ) .getIdentityPreservingEnclosingPattern ( )
195+ nodeTo .asPattern ( ) =
196+ [
197+ nodeFrom .asPattern ( ) .( IsPattern ) .getSubPattern ( ) ,
198+ nodeFrom .asPattern ( ) .( TypedPattern ) .getSubPattern ( )
199+ ]
196200 or
197201 // flow through a flow summary (extension of `SummaryModelCsv`)
198202 FlowSummaryImpl:: Private:: Steps:: summaryLocalStep ( nodeFrom , nodeTo , true )
Original file line number Diff line number Diff line change @@ -85,16 +85,6 @@ class Pattern extends Generated::Pattern {
8585 result = this .getFullyUnresolved ( ) .( Pattern ) .getImmediateEnclosingPattern ( )
8686 }
8787
88- /**
89- * Gets the parent pattern of this pattern, but only if
90- * both patterns match against the same object, which is not
91- * the case when destructuring a complex data structure,
92- * like a tuple or enum.
93- */
94- final Pattern getIdentityPreservingEnclosingPattern ( ) {
95- result = this .getFullyUnresolved ( ) .( Pattern ) .getImmediateIdentityPreservingEnclosingPattern ( )
96- }
97-
9888 /**
9989 * Gets the parent pattern of this pattern, if any.
10090 */
@@ -105,16 +95,6 @@ class Pattern extends Generated::Pattern {
10595 or
10696 this = result .( TuplePattern ) .getImmediateElement ( _)
10797 or
108- result = this .getImmediateIdentityPreservingEnclosingPattern ( )
109- }
110-
111- /**
112- * Gets the immediate parent pattern of this pattern, but only if
113- * both patterns match against the same object, which is not
114- * the case when destructuring a complex data structure,
115- * like a tuple or enum.
116- */
117- Pattern getImmediateIdentityPreservingEnclosingPattern ( ) {
11898 this = result .( BindingPattern ) .getImmediateSubPattern ( )
11999 or
120100 this = result .( IsPattern ) .getImmediateSubPattern ( )
You can’t perform that action at this time.
0 commit comments