fixes #5264 (#5520); inheriting from generic object

This commit is contained in:
andri lim 2017-03-15 03:40:09 +07:00 • committed by Andreas Rumpf
commit 0ff1190fe7
6 changed files with 184 additions and 2 deletions

View file

@ -0,0 +1,30 @@
discard """
file: "tparameterizedparent4.nim"
line: 23
errormsg: "redefinition of 'grain'"
"""
# bug #5264
type
Texture = enum
Smooth
Coarse
FruitBase = object of RootObj
color: int
grain: string
Apple[T] = object of T
width: int
tast_e: float64
case kind: Texture
of Smooth:
skin: float64
of Coarse:
grain: int
proc setColor(self: var FruitBase, c: int) =
self.color = c
var x = Apple[FruitBase](kind: Smooth, skin: 1.5)
x.setColor(14)
echo x