summary refs log tree commit diff stats
path: root/tests/accept/run/tofopr.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/accept/run/tofopr.nim')
-rwxr-xr-xtests/accept/run/tofopr.nim26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/accept/run/tofopr.nim b/tests/accept/run/tofopr.nim
new file mode 100755
index 000000000..f9c21ad16
--- /dev/null
+++ b/tests/accept/run/tofopr.nim
@@ -0,0 +1,26 @@
+discard """
+  file: "tofopr.nim"
+  output: "falsetrue"
+"""
+# Test is operator
+
+type
+  TMyType = object
+    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
+
+