Expose whether functions are variadic in their pp() output

This commit is contained in:
Chris Smowton 2024-08-26 23:43:15 +01:00
Родитель 4dbb15ddda
Коммит 4d3a140dd7
1 изменённых файлов: 6 добавлений и 3 удалений

Просмотреть файл

@ -921,9 +921,12 @@ class SignatureType extends @signaturetype, CompositeType {
language[monotonicAggregates] language[monotonicAggregates]
override string pp() { override string pp() {
result = exists(string suffix | (if this.isVariadic() then suffix = "[variadic]" else suffix = "") |
"func(" + concat(int i, Type tp | tp = this.getParameterType(i) | tp.pp(), ", " order by i) + result =
") " + concat(int i, Type tp | tp = this.getResultType(i) | tp.pp(), ", " order by i) "func(" + concat(int i, Type tp | tp = this.getParameterType(i) | tp.pp(), ", " order by i) +
") " + concat(int i, Type tp | tp = this.getResultType(i) | tp.pp(), ", " order by i) +
" " + suffix
)
} }
override string toString() { result = "signature type" } override string toString() { result = "signature type" }