| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -921,12 +921,20 @@ class SignatureType extends @signaturetype, CompositeType { | |||
| 921 | 921 | ||
| 922 | 922 | language[monotonicAggregates] | |
| 923 | 923 | override string pp() { | |
| 924 | - exists(string suffix | (if this.isVariadic() then suffix = " [variadic]" else suffix = "") | | ||
| 925 | - result = | ||
| 926 | - "func(" + concat(int i, Type tp | tp = this.getParameterType(i) | tp.pp(), ", " order by i) + | ||
| 927 | - ") " + concat(int i, Type tp | tp = this.getResultType(i) | tp.pp(), ", " order by i) + | ||
| 928 | - suffix | ||
| 929 | - ) | ||
| 924 | + result = | ||
| 925 | + "func(" + | ||
| 926 | + concat(int i, Type tp, string prefix | | ||
| 927 | + if i = this.getNumParameter() - 1 and this.isVariadic() | ||
| 928 | + then | ||
| 929 | + tp = this.getParameterType(i).(SliceType).getElementType() and | ||
| 930 | + prefix = "..." | ||
| 931 | + else ( | ||
| 932 | + tp = this.getParameterType(i) and | ||
| 933 | + prefix = "" | ||
| 934 | + ) | ||
| 935 | + | | ||
| 936 | + prefix + tp.pp(), ", " order by i | ||
| 937 | + ) + ") " + concat(int i, Type tp | tp = this.getResultType(i) | tp.pp(), ", " order by i) | ||
| 930 | 938 | } | |
| 931 | 939 | ||
| 932 | 940 | override string toString() { result = "signature type" } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -53,10 +53,10 @@ input.go: | |||
| 53 | 53 | # 20| 0: [CallExpr] call to Println | |
| 54 | 54 | # 20| Type = (int, error) | |
| 55 | 55 | # 20| 0: [FunctionName, SelectorExpr] selection of Println | |
| 56 | - # 20| Type = func([]interface { }) int, error [variadic] | ||
| 56 | + # 20| Type = func(...interface { }) int, error | ||
| 57 | 57 | # 20| 0: [Ident, PackageName] fmt | |
| 58 | 58 | # 20| 1: [FunctionName, Ident] Println | |
| 59 | - # 20| Type = func([]interface { }) int, error [variadic] | ||
| 59 | + # 20| Type = func(...interface { }) int, error | ||
| 60 | 60 | # 20| 1: [StringLit] "Hi" | |
| 61 | 61 | # 20| Type = string | |
| 62 | 62 | # 20| Value = [StringLit] Hi | |
@@ -203,10 +203,10 @@ input.go: | |||
| 203 | 203 | # 52| 0: [CallExpr] call to Println | |
| 204 | 204 | # 52| Type = (int, error) | |
| 205 | 205 | # 52| 0: [FunctionName, SelectorExpr] selection of Println | |
| 206 | - # 52| Type = func([]interface { }) int, error [variadic] | ||
| 206 | + # 52| Type = func(...interface { }) int, error | ||
| 207 | 207 | # 52| 0: [Ident, PackageName] fmt | |
| 208 | 208 | # 52| 1: [FunctionName, Ident] Println | |
| 209 | - # 52| Type = func([]interface { }) int, error [variadic] | ||
| 209 | + # 52| Type = func(...interface { }) int, error | ||
| 210 | 210 | # 52| 1: [StringLit] "Heard from ch1" | |
| 211 | 211 | # 52| Type = string | |
| 212 | 212 | # 52| Value = [StringLit] Heard from ch1 | |
@@ -229,31 +229,31 @@ input.go: | |||
| 229 | 229 | # 54| 0: [CallExpr] call to Println | |
| 230 | 230 | # 54| Type = (int, error) | |
| 231 | 231 | # 54| 0: [FunctionName, SelectorExpr] selection of Println | |
| 232 | - # 54| Type = func([]interface { }) int, error [variadic] | ||
| 232 | + # 54| Type = func(...interface { }) int, error | ||
| 233 | 233 | # 54| 0: [Ident, PackageName] fmt | |
| 234 | 234 | # 54| 1: [FunctionName, Ident] Println | |
| 235 | - # 54| Type = func([]interface { }) int, error [variadic] | ||
| 235 | + # 54| Type = func(...interface { }) int, error | ||
| 236 | 236 | # 54| 1: [Ident, VariableName] a | |
| 237 | 237 | # 54| Type = [1]float32 | |
| 238 | 238 | # 55| 2: [ExprStmt] expression statement | |
| 239 | 239 | # 55| 0: [CallExpr] call to Println | |
| 240 | 240 | # 55| Type = (int, error) | |
| 241 | 241 | # 55| 0: [FunctionName, SelectorExpr] selection of Println | |
| 242 | - # 55| Type = func([]interface { }) int, error [variadic] | ||
| 242 | + # 55| Type = func(...interface { }) int, error | ||
| 243 | 243 | # 55| 0: [Ident, PackageName] fmt | |
| 244 | 244 | # 55| 1: [FunctionName, Ident] Println | |
| 245 | - # 55| Type = func([]interface { }) int, error [variadic] | ||
| 245 | + # 55| Type = func(...interface { }) int, error | ||
| 246 | 246 | # 55| 1: [Ident, VariableName] w | |
| 247 | 247 | # 55| Type = bool | |
| 248 | 248 | # 56| 2: [CommClause] comm clause | |
| 249 | 249 | # 57| 0: [ExprStmt] expression statement | |
| 250 | 250 | # 57| 0: [CallExpr] call to Println | |
| 251 | 251 | # 57| Type = (int, error) | |
| 252 | 252 | # 57| 0: [FunctionName, SelectorExpr] selection of Println | |
| 253 | - # 57| Type = func([]interface { }) int, error [variadic] | ||
| 253 | + # 57| Type = func(...interface { }) int, error | ||
| 254 | 254 | # 57| 0: [Ident, PackageName] fmt | |
| 255 | 255 | # 57| 1: [FunctionName, Ident] Println | |
| 256 | - # 57| Type = func([]interface { }) int, error [variadic] | ||
| 256 | + # 57| Type = func(...interface { }) int, error | ||
| 257 | 257 | # 58| 3: [CommClause] comm clause | |
| 258 | 258 | # 58| 0: [SendStmt] send statement | |
| 259 | 259 | # 58| 0: [Ident, VariableName] ch1 | |
@@ -297,10 +297,10 @@ input.go: | |||
| 297 | 297 | # 67| 0: [CallExpr] call to Println | |
| 298 | 298 | # 67| Type = (int, error) | |
| 299 | 299 | # 67| 0: [FunctionName, SelectorExpr] selection of Println | |
| 300 | - # 67| Type = func([]interface { }) int, error [variadic] | ||
| 300 | + # 67| Type = func(...interface { }) int, error | ||
| 301 | 301 | # 67| 0: [Ident, PackageName] fmt | |
| 302 | 302 | # 67| 1: [FunctionName, Ident] Println | |
| 303 | - # 67| Type = func([]interface { }) int, error [variadic] | ||
| 303 | + # 67| Type = func(...interface { }) int, error | ||
| 304 | 304 | # 67| 1: [Ident, VariableName] x | |
| 305 | 305 | # 67| Type = int | |
| 306 | 306 | # 68| 2: [BlockStmt] block statement | |
@@ -316,10 +316,10 @@ input.go: | |||
| 316 | 316 | # 69| 0: [CallExpr] call to Println | |
| 317 | 317 | # 69| Type = (int, error) | |
| 318 | 318 | # 69| 0: [FunctionName, SelectorExpr] selection of Println | |
| 319 | - # 69| Type = func([]interface { }) int, error [variadic] | ||
| 319 | + # 69| Type = func(...interface { }) int, error | ||
| 320 | 320 | # 69| 0: [Ident, PackageName] fmt | |
| 321 | 321 | # 69| 1: [FunctionName, Ident] Println | |
| 322 | - # 69| Type = func([]interface { }) int, error [variadic] | ||
| 322 | + # 69| Type = func(...interface { }) int, error | ||
| 323 | 323 | # 69| 1: [MinusExpr] -... | |
| 324 | 324 | # 69| Type = int | |
| 325 | 325 | # 69| 0: [Ident, VariableName] x | |
@@ -474,10 +474,10 @@ input.go: | |||
| 474 | 474 | # 115| 0: [CallExpr] call to Println | |
| 475 | 475 | # 115| Type = (int, error) | |
| 476 | 476 | # 115| 0: [FunctionName, SelectorExpr] selection of Println | |
| 477 | - # 115| Type = func([]interface { }) int, error [variadic] | ||
| 477 | + # 115| Type = func(...interface { }) int, error | ||
| 478 | 478 | # 115| 0: [Ident, PackageName] fmt | |
| 479 | 479 | # 115| 1: [FunctionName, Ident] Println | |
| 480 | - # 115| Type = func([]interface { }) int, error [variadic] | ||
| 480 | + # 115| Type = func(...interface { }) int, error | ||
| 481 | 481 | # 115| 1: [Ident, VariableName] y | |
| 482 | 482 | # 115| Type = interface { } | |
| 483 | 483 | # 116| 1: [CaseClause] case clause | |
@@ -566,10 +566,10 @@ input.go: | |||
| 566 | 566 | # 138| 0: [CallExpr] call to Print | |
| 567 | 567 | # 138| Type = (int, error) | |
| 568 | 568 | # 138| 0: [FunctionName, SelectorExpr] selection of Print | |
| 569 | - # 138| Type = func([]interface { }) int, error [variadic] | ||
| 569 | + # 138| Type = func(...interface { }) int, error | ||
| 570 | 570 | # 138| 0: [Ident, PackageName] fmt | |
| 571 | 571 | # 138| 1: [FunctionName, Ident] Print | |
| 572 | - # 138| Type = func([]interface { }) int, error [variadic] | ||
| 572 | + # 138| Type = func(...interface { }) int, error | ||
| 573 | 573 | # 138| 1: [Ident, VariableName] x | |
| 574 | 574 | # 138| Type = int | |
| 575 | 575 | # 141| 1: [RangeStmt] range statement | |
@@ -584,10 +584,10 @@ input.go: | |||
| 584 | 584 | # 142| 0: [CallExpr] call to Print | |
| 585 | 585 | # 142| Type = (int, error) | |
| 586 | 586 | # 142| 0: [FunctionName, SelectorExpr] selection of Print | |
| 587 | - # 142| Type = func([]interface { }) int, error [variadic] | ||
| 587 | + # 142| Type = func(...interface { }) int, error | ||
| 588 | 588 | # 142| 0: [Ident, PackageName] fmt | |
| 589 | 589 | # 142| 1: [FunctionName, Ident] Print | |
| 590 | - # 142| Type = func([]interface { }) int, error [variadic] | ||
| 590 | + # 142| Type = func(...interface { }) int, error | ||
| 591 | 591 | # 142| 1: [Ident, VariableName] i | |
| 592 | 592 | # 142| Type = int | |
| 593 | 593 | # 142| 2: [Ident, VariableName] v | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,10 +33,10 @@ input.go: | |||
| 33 | 33 | # 20| 0: [CallExpr] call to Println | |
| 34 | 34 | # 20| Type = (int, error) | |
| 35 | 35 | # 20| 0: [FunctionName, SelectorExpr] selection of Println | |
| 36 | - # 20| Type = func([]interface { }) int, error [variadic] | ||
| 36 | + # 20| Type = func(...interface { }) int, error | ||
| 37 | 37 | # 20| 0: [Ident, PackageName] fmt | |
| 38 | 38 | # 20| 1: [FunctionName, Ident] Println | |
| 39 | - # 20| Type = func([]interface { }) int, error [variadic] | ||
| 39 | + # 20| Type = func(...interface { }) int, error | ||
| 40 | 40 | # 20| 1: [StringLit] "Hi" | |
| 41 | 41 | # 20| Type = string | |
| 42 | 42 | # 20| Value = [StringLit] Hi | |
@@ -183,10 +183,10 @@ input.go: | |||
| 183 | 183 | # 52| 0: [CallExpr] call to Println | |
| 184 | 184 | # 52| Type = (int, error) | |
| 185 | 185 | # 52| 0: [FunctionName, SelectorExpr] selection of Println | |
| 186 | - # 52| Type = func([]interface { }) int, error [variadic] | ||
| 186 | + # 52| Type = func(...interface { }) int, error | ||
| 187 | 187 | # 52| 0: [Ident, PackageName] fmt | |
| 188 | 188 | # 52| 1: [FunctionName, Ident] Println | |
| 189 | - # 52| Type = func([]interface { }) int, error [variadic] | ||
| 189 | + # 52| Type = func(...interface { }) int, error | ||
| 190 | 190 | # 52| 1: [StringLit] "Heard from ch1" | |
| 191 | 191 | # 52| Type = string | |
| 192 | 192 | # 52| Value = [StringLit] Heard from ch1 | |
@@ -209,31 +209,31 @@ input.go: | |||
| 209 | 209 | # 54| 0: [CallExpr] call to Println | |
| 210 | 210 | # 54| Type = (int, error) | |
| 211 | 211 | # 54| 0: [FunctionName, SelectorExpr] selection of Println | |
| 212 | - # 54| Type = func([]interface { }) int, error [variadic] | ||
| 212 | + # 54| Type = func(...interface { }) int, error | ||
| 213 | 213 | # 54| 0: [Ident, PackageName] fmt | |
| 214 | 214 | # 54| 1: [FunctionName, Ident] Println | |
| 215 | - # 54| Type = func([]interface { }) int, error [variadic] | ||
| 215 | + # 54| Type = func(...interface { }) int, error | ||
| 216 | 216 | # 54| 1: [Ident, VariableName] a | |
| 217 | 217 | # 54| Type = [1]float32 | |
| 218 | 218 | # 55| 2: [ExprStmt] expression statement | |
| 219 | 219 | # 55| 0: [CallExpr] call to Println | |
| 220 | 220 | # 55| Type = (int, error) | |
| 221 | 221 | # 55| 0: [FunctionName, SelectorExpr] selection of Println | |
| 222 | - # 55| Type = func([]interface { }) int, error [variadic] | ||
| 222 | + # 55| Type = func(...interface { }) int, error | ||
| 223 | 223 | # 55| 0: [Ident, PackageName] fmt | |
| 224 | 224 | # 55| 1: [FunctionName, Ident] Println | |
| 225 | - # 55| Type = func([]interface { }) int, error [variadic] | ||
| 225 | + # 55| Type = func(...interface { }) int, error | ||
| 226 | 226 | # 55| 1: [Ident, VariableName] w | |
| 227 | 227 | # 55| Type = bool | |
| 228 | 228 | # 56| 2: [CommClause] comm clause | |
| 229 | 229 | # 57| 0: [ExprStmt] expression statement | |
| 230 | 230 | # 57| 0: [CallExpr] call to Println | |
| 231 | 231 | # 57| Type = (int, error) | |
| 232 | 232 | # 57| 0: [FunctionName, SelectorExpr] selection of Println | |
| 233 | - # 57| Type = func([]interface { }) int, error [variadic] | ||
| 233 | + # 57| Type = func(...interface { }) int, error | ||
| 234 | 234 | # 57| 0: [Ident, PackageName] fmt | |
| 235 | 235 | # 57| 1: [FunctionName, Ident] Println | |
| 236 | - # 57| Type = func([]interface { }) int, error [variadic] | ||
| 236 | + # 57| Type = func(...interface { }) int, error | ||
| 237 | 237 | # 58| 3: [CommClause] comm clause | |
| 238 | 238 | # 58| 0: [SendStmt] send statement | |
| 239 | 239 | # 58| 0: [Ident, VariableName] ch1 | |
@@ -277,10 +277,10 @@ input.go: | |||
| 277 | 277 | # 67| 0: [CallExpr] call to Println | |
| 278 | 278 | # 67| Type = (int, error) | |
| 279 | 279 | # 67| 0: [FunctionName, SelectorExpr] selection of Println | |
| 280 | - # 67| Type = func([]interface { }) int, error [variadic] | ||
| 280 | + # 67| Type = func(...interface { }) int, error | ||
| 281 | 281 | # 67| 0: [Ident, PackageName] fmt | |
| 282 | 282 | # 67| 1: [FunctionName, Ident] Println | |
| 283 | - # 67| Type = func([]interface { }) int, error [variadic] | ||
| 283 | + # 67| Type = func(...interface { }) int, error | ||
| 284 | 284 | # 67| 1: [Ident, VariableName] x | |
| 285 | 285 | # 67| Type = int | |
| 286 | 286 | # 68| 2: [BlockStmt] block statement | |
@@ -296,10 +296,10 @@ input.go: | |||
| 296 | 296 | # 69| 0: [CallExpr] call to Println | |
| 297 | 297 | # 69| Type = (int, error) | |
| 298 | 298 | # 69| 0: [FunctionName, SelectorExpr] selection of Println | |
| 299 | - # 69| Type = func([]interface { }) int, error [variadic] | ||
| 299 | + # 69| Type = func(...interface { }) int, error | ||
| 300 | 300 | # 69| 0: [Ident, PackageName] fmt | |
| 301 | 301 | # 69| 1: [FunctionName, Ident] Println | |
| 302 | - # 69| Type = func([]interface { }) int, error [variadic] | ||
| 302 | + # 69| Type = func(...interface { }) int, error | ||
| 303 | 303 | # 69| 1: [MinusExpr] -... | |
| 304 | 304 | # 69| Type = int | |
| 305 | 305 | # 69| 0: [Ident, VariableName] x | |
@@ -454,10 +454,10 @@ input.go: | |||
| 454 | 454 | # 115| 0: [CallExpr] call to Println | |
| 455 | 455 | # 115| Type = (int, error) | |
| 456 | 456 | # 115| 0: [FunctionName, SelectorExpr] selection of Println | |
| 457 | - # 115| Type = func([]interface { }) int, error [variadic] | ||
| 457 | + # 115| Type = func(...interface { }) int, error | ||
| 458 | 458 | # 115| 0: [Ident, PackageName] fmt | |
| 459 | 459 | # 115| 1: [FunctionName, Ident] Println | |
| 460 | - # 115| Type = func([]interface { }) int, error [variadic] | ||
| 460 | + # 115| Type = func(...interface { }) int, error | ||
| 461 | 461 | # 115| 1: [Ident, VariableName] y | |
| 462 | 462 | # 115| Type = interface { } | |
| 463 | 463 | # 116| 1: [CaseClause] case clause | |
@@ -546,10 +546,10 @@ input.go: | |||
| 546 | 546 | # 138| 0: [CallExpr] call to Print | |
| 547 | 547 | # 138| Type = (int, error) | |
| 548 | 548 | # 138| 0: [FunctionName, SelectorExpr] selection of Print | |
| 549 | - # 138| Type = func([]interface { }) int, error [variadic] | ||
| 549 | + # 138| Type = func(...interface { }) int, error | ||
| 550 | 550 | # 138| 0: [Ident, PackageName] fmt | |
| 551 | 551 | # 138| 1: [FunctionName, Ident] Print | |
| 552 | - # 138| Type = func([]interface { }) int, error [variadic] | ||
| 552 | + # 138| Type = func(...interface { }) int, error | ||
| 553 | 553 | # 138| 1: [Ident, VariableName] x | |
| 554 | 554 | # 138| Type = int | |
| 555 | 555 | # 141| 1: [RangeStmt] range statement | |
@@ -564,10 +564,10 @@ input.go: | |||
| 564 | 564 | # 142| 0: [CallExpr] call to Print | |
| 565 | 565 | # 142| Type = (int, error) | |
| 566 | 566 | # 142| 0: [FunctionName, SelectorExpr] selection of Print | |
| 567 | - # 142| Type = func([]interface { }) int, error [variadic] | ||
| 567 | + # 142| Type = func(...interface { }) int, error | ||
| 568 | 568 | # 142| 0: [Ident, PackageName] fmt | |
| 569 | 569 | # 142| 1: [FunctionName, Ident] Print | |
| 570 | - # 142| Type = func([]interface { }) int, error [variadic] | ||
| 570 | + # 142| Type = func(...interface { }) int, error | ||
| 571 | 571 | # 142| 1: [Ident, VariableName] i | |
| 572 | 572 | # 142| Type = int | |
| 573 | 573 | # 142| 2: [Ident, VariableName] v | |
| Back | FazBrowse Home | New Git URL |
0 commit comments