fixes #5478
This commit is contained in:
parent
8c0e27e8d9
commit
4a77b66b19
2 changed files with 26 additions and 4 deletions
22
tests/template/tmixin_in_proc.nim
Normal file
22
tests/template/tmixin_in_proc.nim
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
discard """
|
||||
output: '''monkey'''
|
||||
"""
|
||||
# bug #5478
|
||||
template creature*(name: untyped) =
|
||||
type
|
||||
name*[T] = object
|
||||
color: T
|
||||
|
||||
proc `init name`*[T](c: T): name[T] =
|
||||
mixin transform
|
||||
transform()
|
||||
|
||||
creature(Lion)
|
||||
|
||||
type Monkey* = object
|
||||
proc transform*() =
|
||||
echo "monkey"
|
||||
|
||||
var
|
||||
m: Monkey
|
||||
y = initLion(m) #this one failed to compile
|
||||
Loading…
Add table
Add a link
Reference in a new issue