summary refs log tree commit diff stats
diff options
context:
space:
mode:
authoree7 <45465154+ee7@users.noreply.github.com>2021-10-15 09:10:27 +0200
committerGitHub <noreply@github.com>2021-10-15 09:10:27 +0200
commitf4525efcf3b915be8e17c9730e9e0ffd0afe3a0f (patch)
tree0c5dc9c52aabee538beed65f40ff04510a4c8b4d
parent73330711a3d753d25b073fb1dc24cb16e559724d (diff)
downloadNim-f4525efcf3b915be8e17c9730e9e0ffd0afe3a0f.tar.gz
changelog_1_6_0: mention breaking change in effect tracking (#18995)
-rw-r--r--changelogs/changelog_1_6_0.md30
1 files changed, 30 insertions, 0 deletions
diff --git a/changelogs/changelog_1_6_0.md b/changelogs/changelog_1_6_0.md
index 1ce6c2093..4a1047d20 100644
--- a/changelogs/changelog_1_6_0.md
+++ b/changelogs/changelog_1_6_0.md
@@ -905,6 +905,36 @@ Compatibility notes:
   to avoid ugly, non-portable solutions. See RFC
   [#407](https://github.com/nim-lang/RFCs/issues/407) for more details.
 
+Compatibility notes:
+- Fixed effect tracking for borrowed procs (see [#18882](https://github.com/nim-lang/Nim/pull/18882)).
+  One consequence is that, under some circumstances, Nim could previously permit a procedure with side effects to be written with `func` - you may need to change some occurrences of `func` to `proc`.
+  To illustrate, Nim versions before 1.6.0 compile the below without error
+  ```nim
+  proc print(s: string) =
+    echo s
+
+  type
+    MyString = distinct string
+
+  proc print(s: MyString) {.borrow.}
+
+  func foo(s: MyString) =
+    print(s)
+  ```
+  but Nim 1.6.0 produces the error
+  ```
+  Error: 'foo' can have side effects
+  ```
+  similar to how we expect that
+  ```nim
+  func print(s: string) =
+    echo s
+  ```
+  produces
+  ```
+  Error: 'print' can have side effects
+  ```
+
 
 ## Tools