mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-25 04:15:09 +00:00
* fixes #7601, array construction of ptr generics * add more test
This commit is contained in:
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]
|
||||
Reference in New Issue
Block a user