summary refs log tree commit diff stats
path: root/tests/accept/run/tisopr.nim
blob: 7e7a8f650fa1864a57e6153b6083f32be8cbc497 (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
discard """
  file: "tisopr.nim"
  output: "falsetrue"
"""
# Test is operator

type
  TMyType = object
    len: int
    data: string
    
  TOtherType = object of TMyType
   
proc p(x: TMyType): bool = 
  return x is TOtherType
    
var
  m: TMyType
  n: TOtherType

write(stdout, p(m))
write(stdout, p(n))

#OUT falsetrue