Nim version 2.2.12 released

The Nim Team is happy to announce version 2.2.12, the sixth patch release for our stable release, Nim 2.2.

It comes four months after the 2.2.10 release and it contains 142 commits, bringing bugfixes and improvements.

If you’re still on Nim 1.6, take a look at the version 2.0 release article to see all the features you’re missing. If you’ve been using Nim 2.0, the version 2.2 release article shows the improvements available in Nim 2.2.

Installing Nim 2.2.12

Check out if the package manager of your OS already ships version 2.2.12 or install it as described here.

If you have installed a previous version of Nim using choosenim, getting Nim 2.2.12 is as easy as:

$ choosenim update self
$ choosenim update stable

NOTE: We recommend that you install and use the latest version of choosenim, v0.8.16, available in our choosenim repo.

Alternatively, you can download Nim 2.2.12 from our nightlies builds.

Bugfixes

  • Fixed “distinctBase(distinct L[int, 100]) does not match L” (#25789)
  • Fixed “& (strformat): interprets {n-1} as {n(-1)}” (#25821)
  • Fixed “[C++] ICE expr(sktype): unknown symbol when bindSym constructor proc in macro” (#25814)
  • Fixed “SIGSEGV with refc and RVO” (#25294)
  • Fixed “Poor error message on cast effect violation” (#22950)
  • Fixed “ProveField warning with nested case object” (#22791)
  • Fixed “incompatible function pointer types C error with uint vs csize_t” (#25617)
  • Fixed “regression from 2.2.10 to devel with lent and type aliasing” (#25796)
  • Fixed “SIGSEGV in ARC/ORC with repeated use of {.dirty.} template and seq allocations” (#25693)
  • Fixed “–panics:on drops the nimErr_ check after a closure call (goto exceptions), causing OverflowDefect; regression from #25295” (#25851)
  • Fixed “typeof(result) wrongly counted as use-before-init of result on {.requiresInit.} return types (regression from #25151)” (#25857)
  • Fixed “Missing eqcopy for value copy of value-type case object with ref field” (#25595)
  • Fixed “Iteration on elements of array, unlike seq, always copies the elements” (#25849)
  • Fixed “Regression from refc on 2.2.x to devel, and refc to ORC on 2.2.x/devel, of redundant stack usage/copies of return value with conditionals/pointers” (#25850)
  • Fixed “Generic inheritance matching gives type mismatch when object has members” (#22936)
  • Fixed “internal error: environment misses: s with iterator/nimvm/variable shadowing” (#25725)
  • Fixed “SIGSEGV in ARC/ORC with repeated use of {.dirty.} template and seq allocations” (#25693)
  • Fixed “Regression from 2.2.10 to version-2-2/devel with proc r(e: ref Exception) {.raises: [IOError].} = raise (ref IOError)(e)” (#25885)
  • Fixed “unhandled exception: closureiters.nim(336, 17) c[i].kind == nkType [AssertionDefect] with closure iterator and except IOError, OSError:” (#25903)
  • Fixed “using quote inside static block causes “Illegal storage access” error” (#18367)
  • Fixed “Regression from 2.2.10 to version-2-2/devel with proc r(e: ref Exception) {.raises: [IOError].} = raise (ref IOError)(e)” (#25885)
  • Fixed “Manual’s “Delegating bind statements” section is nonsense” (#19240)
  • Fixed “Regression from 2.2.10 to version-2-2/devel with {.pure.} enum and generic inline iterator” (#25908)
  • Fixed “type N {.importc: "const void *".} = pointer creates order-dependent compilation failure” (#25931)
  • Fixed “emscripten ICE: cannot map the empty seq type to a C type” (#25945)
  • Fixed “mapIt pointlessly does extra zeroing which, e.g., newSeqWith often avoids” (#25956)
  • Fixed “ImplicitRangeConversion does not recognize constants” (#25608)
  • Fixed “C codegen bug: name mangling collision with nested tuples of matching flattened types” (#25883)
  • Fixed “.forbids. type mismatch with closure types for inner proc” (#25976)
  • Fixed “Nimsuggest SIGSEGVs on any type (ideType) query whose target symbol has no usable type” (#25997)
  • Fixed “self-append uses overlapping copyMem and aborts on OpenBSD when mm = refc” (#26007)
  • Fixed “Cannot add members to enum-indexed array of seqs at compile time” (#26000)
  • Fixed “deepCopy should not be allowed for non-copyable type” (#26019)
  • Fixed “Double destroy with {.cursor.}” (#26010)
  • Fixed “compareExchange applies invalid release semantics on failure” (#26027)
  • Fixed “{.push overflowChecks: off.} pragma escapes when nimvm: block, affecting runtime code” (#26045)
  • Fixed “fatal error: invalid kind for firstOrd(tyEmpty) with proc p(h: static set[bool]) = discard len(h)” (#25942)
  • Fixed “incorrect sink requires a copy because it's not the last read of 's'error in both refc and ARC/ORC” (#26023)
  • Fixed “nimpretty --indent:3 can inject syntax errors “ (#20078)
  • Fixed “performance regression from refc to ORC or --mm:refc --exceptions:goto with impossible defect-checking” (#26036)
  • Fixed “Nested {.cast(gcsafe).} blocks: exiting the inner block cancels the outer block’s cast for the statements after it” (#26092)
  • Fixed “ResultUsed warning behaves inconsistently with manual characterization with--warning:ResultUsed:on” (#26062)
  • Fixed “SIGABRT or SYSASSERT using ARC/ORC with type forward-reference, distinct, and distinctBase with -d:useMalloc or -d:useSysAssert” (#26025)
  • Fixed “(N)RVO-related stack usage and memory copying regression from Nim 2.2.x to version-2-4/devel” (#26112)
  • Fixed “distinct ptr sink’ed too early when only subsequent use is cast” (#26123)
  • Fixed “Error: internal error: expr: param not init k_553648136 with nested generic procs” (#26124)
  • Fixed “refc SIGSEGV on var r = V(g: true, v: A()); discard move r; GC_fullCollect() on case object” (#25992)
  • Fixed “Possible memory error (“use after free”)” (#26143)
  • Fixed “importc types (eg cint) don’t alias properly, causing codegen errors” (#11797)
  • Fixed “del(seq) performs self-assignment and =destroy for del(0) of 1-length seq” (#26134)
  • Fixed “=destroy should accept non-parametrized generic” (#26132)
  • Fixed “JS regression: dockhack.js is invalid” (#26152)
  • Fixed “Regression from 2.2.x to version-2-4/devel with stack usage increase on try/except expression with refc” (#26119)
  • Fixed “std/encodings: convert silently corrupts stateful encodings (ISO-2022-JP) when the output buffer grows” (#26173)
  • Fixed “Utf16Char incorrectly declared as signed” (#26175)

The complete list of changes is available here.