mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 01:14:41 +00:00
27 lines
329 B
Nim
27 lines
329 B
Nim
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
|
|
|
|
|