File tree Expand file tree Collapse file tree
lib/codeql/unified/internal
test/library-tests/variables Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -178,12 +178,12 @@ private module LocalNameBindingInput implements LocalNameBindingInputSig<Locatio
178178 )
179179 or
180180 exists ( CatchClause catch |
181- scope = catch and // ensure both ' body' and 'guard' clause are in scope
181+ scope = catch and // ensure both body and pattern are in scope
182182 pattern = catch .getPattern ( )
183183 )
184184 or
185185 exists ( SwitchCase case |
186- scope = case and // ensure both ' body' and 'guard' clause are in scope (TODO: merge CatchClause and SwitchCase?)
186+ scope = case and // ensure both body and pattern are in scope
187187 pattern = case .getPattern ( )
188188 )
189189 or
@@ -207,6 +207,11 @@ private module LocalNameBindingInput implements LocalNameBindingInputSig<Locatio
207207 pattern = pat .getPattern ( _)
208208 )
209209 or
210+ exists ( ConditionalPattern pat |
211+ bindingContext ( pat , scope ) and
212+ pattern = pat .getPattern ( )
213+ )
214+ or
210215 exists ( PatternGuardExpr expr |
211216 pattern = expr .getPattern ( ) and
212217 scope = expr
Original file line number Diff line number Diff line change @@ -80,8 +80,8 @@ func t10(value: Int) { // name=value1
8080// Switch with multiple cases
8181func t11( value: Int ) { // name=value1
8282 switch value { // $ access=value1
83- case let x where x > 0 : // $ MISSING: access=x1 // name=x1
84- print ( x) // $ MISSING: access=x1
83+ case let x where x > 0 : // $ access=x1 // name=x1
84+ print ( x) // $ access=x1
8585 case let x: // name=x2
8686 print ( x) // $ access=x2
8787 }
You can’t perform that action at this time.
0 commit comments