summary refs log tree commit diff stats
path: root/tests/magics/t8693.nim
blob: 554244de420077fb79cbfd6dc9d67ec8b9cc20ce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
discard """
  output: '''true
false
true
false
false
true
true
false
true
true
'''
"""

type Foo = int | float

proc bar(t1, t2: typedesc): bool =
  echo (t1 is t2)
  (t2 is t1)

proc bar[T](x: T, t2: typedesc): bool =
  echo (T is t2)
  (t2 is T)

echo bar(int, Foo)
echo bar(4, Foo)
echo bar(any, int)
echo bar(int, any)
echo bar(Foo, Foo)