summary refs log tree commit diff stats
path: root/tests/template/tmixin_in_proc.nim
blob: fede9290b21c4dba58e45c4e08063f8f7e4890e8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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