summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/enum/tambiguousoverloads.nim2
-rw-r--r--tests/errmsgs/t8064.nim3
-rw-r--r--tests/lookups/tambprocvar.nim2
-rw-r--r--tests/specialops/tsetter.nim10
4 files changed, 14 insertions, 3 deletions
diff --git a/tests/enum/tambiguousoverloads.nim b/tests/enum/tambiguousoverloads.nim
index 1b0d92608..aa75eaa91 100644
--- a/tests/enum/tambiguousoverloads.nim
+++ b/tests/enum/tambiguousoverloads.nim
@@ -9,7 +9,7 @@ block: # bug #21887
     EnumC = enum C
 
   doAssert typeof(EnumC(A)) is EnumC #[tt.Error
-                       ^ ambiguous identifier 'A' -- use one of the following:
+                        ^ ambiguous identifier 'A' -- use one of the following:
   EnumA.A: EnumA
   EnumB.A: EnumB]#
 
diff --git a/tests/errmsgs/t8064.nim b/tests/errmsgs/t8064.nim
index e7941e36a..6be83fd1a 100644
--- a/tests/errmsgs/t8064.nim
+++ b/tests/errmsgs/t8064.nim
@@ -4,5 +4,6 @@ values
 
 
 discard """
-  errormsg: "expression has no type: values"
+  # either this or "expression has no type":
+  errormsg: "ambiguous identifier 'values' -- use one of the following:"
 """
diff --git a/tests/lookups/tambprocvar.nim b/tests/lookups/tambprocvar.nim
index 2a9921bad..33323fbb2 100644
--- a/tests/lookups/tambprocvar.nim
+++ b/tests/lookups/tambprocvar.nim
@@ -16,4 +16,4 @@ block:
 
 block:
   let x = `+` #[tt.Error
-          ^ ambiguous identifier '+' -- use one of the following:]#
+           ^ ambiguous identifier '+' -- use one of the following:]#
diff --git a/tests/specialops/tsetter.nim b/tests/specialops/tsetter.nim
new file mode 100644
index 000000000..6175cbec4
--- /dev/null
+++ b/tests/specialops/tsetter.nim
@@ -0,0 +1,10 @@
+block: # ensure RHS of setter statement is treated as call operand
+  proc `b=`(a: var int, c: proc (x: int): int) =
+    a = c(a)
+
+  proc foo(x: int): int = x + 1
+  proc foo(x: float): float = x - 1
+
+  var a = 123
+  a.b = foo
+  doAssert a == 124