bugfix: allow tuple constructors in generic code
This commit is contained in:
parent
7e44015491
commit
698785ef5e
2 changed files with 7 additions and 0 deletions
|
|
@ -6,12 +6,16 @@ discard """
|
|||
import typetraits
|
||||
|
||||
proc plus(a, b): auto = a + b
|
||||
proc makePair(a, b): auto = (first: a, second: b)
|
||||
|
||||
proc `+`(a, b: string): seq[string] = @[a, b]
|
||||
|
||||
var i = plus(10, 20)
|
||||
var s = plus("A", "B")
|
||||
|
||||
var p = makePair("key", 100)
|
||||
static: assert p[0].type is string
|
||||
|
||||
echo i.type.name
|
||||
echo s.type.name
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue