Skip to content

Commit d7d653b

Browse files
committed
Fix tuple stubbing with arity < 2
1 parent 2edfa15 commit d7d653b

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

csharp/ql/src/Stubs/Stubs.qll

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -429,13 +429,16 @@ private string stubClassName(Type t) {
429429
else
430430
if t instanceof TupleType
431431
then
432-
result =
433-
"(" +
434-
concat(int i, Type element |
435-
element = t.(TupleType).getElementType(i)
436-
|
437-
stubClassName(element), "," order by i
438-
) + ")"
432+
if t.(TupleType).getArity() < 2
433+
then result = stubClassName(t.(TupleType).getUnderlyingType())
434+
else
435+
result =
436+
"(" +
437+
concat(int i, Type element |
438+
element = t.(TupleType).getElementType(i)
439+
|
440+
stubClassName(element), "," order by i
441+
) + ")"
439442
else
440443
if t instanceof ValueOrRefType
441444
then

0 commit comments

Comments
 (0)