A more efficient implementation is possible by restoring the old lifting ot tyGenericInvocation to tyGenericInst in liftTypeParam, but this fix will suffice for now. fixes #5087 fixes #5602 fixes #5641 fixes #5570
18 lines
323 B
Nim
18 lines
323 B
Nim
discard """
|
|
output: "seq[float]\n0"
|
|
"""
|
|
|
|
# https://github.com/nim-lang/Nim/issues/5602
|
|
|
|
import typetraits
|
|
|
|
type
|
|
Foo[T] = object of RootObj
|
|
Bar[T] = object of Foo[seq[T]]
|
|
|
|
proc p[T](f: Foo[T]): T =
|
|
echo T.name
|
|
|
|
var s: Bar[float]
|
|
echo p(s).len # the bug was: p(s) should return seq[float], but returns float instead
|
|
|