Skip to content

Commit 41bd516

Browse files
committed
unified: Use start-line for detecting variable aliases
1 parent d28b149 commit 41bd516

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

unified/ql/test/library-tests/variables/test.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,10 @@ enum E38 {
343343
}
344344

345345
// Switch with a multi-pattern case that binds 'x' in each pattern
346-
// Note: the testing framework does not make it possible to name the 'x' variable in this case.
347346
func t38(value: E38) {
348347
switch value { // $ access=value
349-
case .a(let x), // $ access=x
350-
.b(let x): // $ access=x
351-
print(x) // $ access=x
348+
case .a(let x), // $ access=x1 // name=x1
349+
.b(let x): // $ access=x1
350+
print(x) // $ access=x1
352351
}
353352
}

unified/ql/test/library-tests/variables/variables.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ module VariableAccessTest implements TestSig {
2525

2626
private predicate declAt(Variable v, string filepath, int line) {
2727
v.getLocation().hasLocationInfo(filepath, _, _, line, _)
28+
v.getLocation().hasLocationInfo(filepath, line, _, _, _)
2829
}
2930

3031
private predicate decl(Variable v, string alias) {

0 commit comments

Comments
 (0)