fixes #5597; wrong eager template instantiation in generic context (#5601)

This commit is contained in:
Andreas Rumpf 2017-03-24 07:35:12 +01:00 • committed by GitHub
commit 0d8a503e45
2 changed files with 16 additions and 3 deletions

View file

@ -14,3 +14,16 @@ proc arrayItem(a: ArrayType): auto =
var arr: ArrayType[int]
echo arrayItem(arr)
# bug #5597
template fail() = "what"
proc g[T](x: var T) =
x.fail = 3
type
Obj = object
fail: int
var y: Obj
g y