fixes #7601, array construction of ptr generics (#7671)

* fixes #7601, array construction of ptr generics

* add more test
This commit is contained in:
andri lim
2018-04-28 02:38:15 +07:00
committed by Andreas Rumpf
parent 822d2b5085
commit 07d6ff4be4
3 changed files with 71 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
discard """
file: "tarraycons_ptr_generic2.nim"
line: 17
errormsg: "type mismatch: got <ptr Hard[system.string]> but expected 'Book[system.string]'"
"""
type
Book[T] = ref object of RootObj
cover: T
Hard[T] = ref object of Book[T]
Soft[T] = ref object of Book[T]
var bn = Book[string](cover: "none")
var hs = Hard[string](cover: "skin")
var bp = Soft[string](cover: "paper")
let z = [bn, hs.addr, bp]