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 {
192
192
)
193
193
or
194
194
// 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
+ ]
196
200
or
197
201
// flow through a flow summary (extension of `SummaryModelCsv`)
198
202
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 {
85
85
result = this .getFullyUnresolved ( ) .( Pattern ) .getImmediateEnclosingPattern ( )
86
86
}
87
87
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
-
98
88
/**
99
89
* Gets the parent pattern of this pattern, if any.
100
90
*/
@@ -105,16 +95,6 @@ class Pattern extends Generated::Pattern {
105
95
or
106
96
this = result .( TuplePattern ) .getImmediateElement ( _)
107
97
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 ( ) {
118
98
this = result .( BindingPattern ) .getImmediateSubPattern ( )
119
99
or
120
100
this = result .( IsPattern ) .getImmediateSubPattern ( )
You can’t perform that action at this time.
0 commit comments