fixes #6682
This commit is contained in:
parent
2f17be9c22
commit
a6226d9452
4 changed files with 35 additions and 2 deletions
26
tests/notnil/tmust_compile.nim
Normal file
26
tests/notnil/tmust_compile.nim
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
discard """
|
||||
output: '''success'''
|
||||
"""
|
||||
|
||||
# bug #6682
|
||||
|
||||
type
|
||||
Fields = enum
|
||||
A=1, B, C
|
||||
|
||||
Obj = object
|
||||
fld: array[Fields, int]
|
||||
|
||||
AsGeneric[T] = array[Fields, T]
|
||||
Obj2[T] = object
|
||||
fld: AsGeneric[T]
|
||||
|
||||
var a: Obj # this works
|
||||
|
||||
var arr: array[Fields, int]
|
||||
|
||||
var b = Obj() # this doesn't (also doesn't works with additional fields)
|
||||
|
||||
var z = Obj2[int]()
|
||||
|
||||
echo "success"
|
||||
Loading…
Add table
Add a link
Reference in a new issue