summary refs log tree commit diff stats
path: root/tests/generics/tlamba_in_generic.nim
blob: 91d417b5eff6cd8cea30c39624e5821806149853 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
discard """
  output: '''!!Hi!!'''
"""
# bug #4658
import future

var x = 123

proc twice[T](f: T -> T): T -> T = (x: T) => f(f(x))

proc quote(s: string): string = "!" & s & "!"

echo twice(quote)("Hi")