This commit is contained in:
Araq 2014-11-30 02:56:26 +01:00
commit a1c217a2db
2 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,13 @@
# bug #1684
type
BaseType {.inheritable pure.} = object
idx: int
DerivedType* {.final pure.} = object of BaseType
proc index*[Toohoo: BaseType](h: Toohoo): int {.inline.} = h.idx
proc newDerived(idx: int): DerivedType {.inline.} = DerivedType(idx: idx)
let d = newDerived(2)
assert(d.index == 2)