summary refs log tree commit diff stats
path: root/testament
diff options
context:
space:
mode:
authorRyan McConnell <rammcconnell@gmail.com>2024-02-20 02:08:16 -0500
committerGitHub <noreply@github.com>2024-02-20 08:08:16 +0100
commitca77423ffc09e92ca17e430bf79c10ae3c1adb63 (patch)
tree08ea830c1ff141c8928c0f2fbd01f6fea3f9ac87 /testament
parent7bf8cd3f8654c152b87052e28c515e525b43b38c (diff)
downloadNim-ca77423ffc09e92ca17e430bf79c10ae3c1adb63.tar.gz
`varargs[typed]` should behave more like `typed` (#23303)
This fixes an oversight with a change that I made a while ago.

Basically, these two snippets should both compile. Currently the
`varargs` version will fail.

```nim
template s(d: typed)=discard
proc something()=discard
proc something(x:int)=discard

s(something)
```

```nim
template s(d: varargs[typed])=discard
proc something()=discard
proc something(x:int)=discard

s(something)
```

Potentially unrelated, but this works currently for some reason:
```nim
template s(a: varargs[typed])=discard
proc something()=discard
proc something(x:int)=discard

s:
  something
```

also, this works:
```nim
template s(b:untyped, a: varargs[typed])=discard
proc something()=discard
proc something(x:int)=discard

s (g: int):
  something
```
but this doesn't, and the error message is not what I would expect:
```nim
template s(b:untyped, a: varargs[typed])=discard
proc something()=discard
proc something(x:int)=discard

s (g: int), something
```

So far as I can tell, none of these issues persist for me after the code
changes in this PR.
Diffstat (limited to 'testament')
0 files changed, 0 insertions, 0 deletions