summary refs log tree commit diff stats
path: root/tests/objvariant/tyaoption.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/objvariant/tyaoption.nim')
-rw-r--r--tests/objvariant/tyaoption.nim12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/objvariant/tyaoption.nim b/tests/objvariant/tyaoption.nim
index 635e60bb8..7a29b8008 100644
--- a/tests/objvariant/tyaoption.nim
+++ b/tests/objvariant/tyaoption.nim
@@ -7,7 +7,7 @@ some(10)'''
 import strutils
 
 type Option[A] = object
-  case isDefined*: Bool
+  case isDefined*: bool
     of true:
       value*: A
     of false:
@@ -19,7 +19,7 @@ proc some[A](value: A): Option[A] =
 proc none[A](): Option[A] =
   Option[A](isDefined: false)
 
-proc `$`[A](o: Option[A]): String =
+proc `$`[A](o: Option[A]): string =
   if o.isDefined:
     "some($1)" % [$o.value]
   else:
@@ -27,14 +27,14 @@ proc `$`[A](o: Option[A]): String =
 
 let x = some("str")
 let y = some(5)
-let z = none[Int]()
+let z = none[int]()
 
 echo x, ", ", y, ", ", z
 
-proc intOrString[A : Int | String](o: Option[A]): Option[A] =
-  when A is Int:
+proc intOrString[A : int | string](o: Option[A]): Option[A] =
+  when A is int:
     some(o.value + 5)
-  elif A is String:
+  elif A is string:
     some(o.value & "!")
   else:
     o