summary refs log blame commit diff stats
path: root/tests/objects/tofopr.nim
blob: ab285457115c07ad4da46e1940cac43bd1d14c7e (plain) (tree)
1
2
3
4
5
6
7
8
9
10
           
                    

                     


                  
                                  

                
 
                                

                          
                        
 







                   

 
discard """
  file: "tofopr.nim"
  output: "falsetrue"
"""
# Test is operator

type
  TMyType = object {.inheritable.}
    len: int
    data: string

  TOtherType = object of TMyType

proc p(x: TMyType): bool =
  return x of TOtherType

var
  m: TMyType
  n: TOtherType

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

#OUT falsetrue