* fixes #7601, array construction of ptr generics * add more test
This commit is contained in:
parent
822d2b5085
commit
07d6ff4be4
3 changed files with 71 additions and 2 deletions
17
tests/array/tarraycons_ptr_generic2.nim
Normal file
17
tests/array/tarraycons_ptr_generic2.nim
Normal 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]
|
||||
Loading…
Add table
Add a link
Reference in a new issue