Files
Nim/tests/array/tarraycons_ptr_generic2.nim
andri lim 07d6ff4be4 fixes #7601, array construction of ptr generics (#7671)
* fixes #7601, array construction of ptr generics

* add more test
2018-04-27 21:38:15 +02:00

18 lines
420 B
Nim

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]