From d31b2df37b3840c40c754c61a254cd666ff66ad1 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Thu, 22 Aug 2024 09:11:54 +0200 Subject: [PATCH 1/2] disable `lent` with `orc` until 2.2 https://github.com/nim-lang/Nim/issues/23973 --- results.nim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/results.nim b/results.nim index 9f8445a..1f7a85a 100644 --- a/results.nim +++ b/results.nim @@ -377,12 +377,17 @@ const resultsGenericsOpenSymWorkaroundHint* {.booldefine.} = true - resultsLent {.booldefine.} = (NimMajor, NimMinor, NimPatch) >= (2, 0, 8) - ## Enable return of `lent` types - this *mostly* works in Nim 1.6.18+ but + resultsLent {.booldefine.} = + (NimMajor, NimMinor, NimPatch) >= (2, 2, 0) or + (defined(gcRefc) and ((NimMajor, NimMinor, NimPatch) >= (2, 0, 8))) + ## Enable return of `lent` types - this *mostly* works in Nim 1.6.18 but ## there have been edge cases reported as late as 1.6.14 - YMMV - ## conservatively, `lent` is therefore enabled only with the latest Nim ## version at the time of writing, where it could be verified to work with ## several large applications. + ## + ## ORC does not work until 2.2+ at the earliest. + ## https://github.com/nim-lang/Nim/issues/23973 when resultsLent: template maybeLent(T: untyped): untyped = From 0de2dc595630ac0bfe0e90a669438ba715172370 Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Thu, 22 Aug 2024 09:46:41 +0200 Subject: [PATCH 2/2] comment --- results.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/results.nim b/results.nim index 1f7a85a..1cb516f 100644 --- a/results.nim +++ b/results.nim @@ -380,13 +380,13 @@ const resultsLent {.booldefine.} = (NimMajor, NimMinor, NimPatch) >= (2, 2, 0) or (defined(gcRefc) and ((NimMajor, NimMinor, NimPatch) >= (2, 0, 8))) - ## Enable return of `lent` types - this *mostly* works in Nim 1.6.18 but + ## Enable return of `lent` types - this *mostly* works in Nim 1.6.18+ but ## there have been edge cases reported as late as 1.6.14 - YMMV - ## conservatively, `lent` is therefore enabled only with the latest Nim ## version at the time of writing, where it could be verified to work with ## several large applications. ## - ## ORC does not work until 2.2+ at the earliest. + ## ORC is not expected to work until 2.2. ## https://github.com/nim-lang/Nim/issues/23973 when resultsLent: