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]
override string pp() {
result =
"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)
exists(string suffix | (if this.isVariadic() then suffix = "[variadic]" else suffix = "") |
result =
"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" }