fixes #19857; Exception raised in closure may be "skipped" in ORC.
add a prepass for codeReordering.
To keep backwards compatibility. It adds a prepass for codeReordering. Before processing all the source code, it iterates all the nodes and looks for {.experimental: "codeReordering"}. If the flag is found, it will enter the processing in the codeReordering mode.
fix #18977; disallow change branch of an object variant in ORC.
type
E = enum
a, b, c, d
X = object
v: int
O = object
case kind: E
of a:
a: int
of {b, c}:
b: float
else:
d: X
proc `=destroy`(x: var X) =
echo "x destroyed"
var o = O(kind: d, d: X(v: 12345))
doAssert o.d.v == 12345
doAssertRaises(FieldDefect):
o.kind = a
You cannot change the branch of o anymore unless you assign to it the same kind or use {.cast(uncheckedAssign).} to permit the operation.
o.kind = d
{.cast(uncheckedAssign).}:
o.kind = a
https://forum.nim-lang.org/t/9908 (2/19)
https://forum.nim-lang.org/t/9940 (2/26)
https://forum.nim-lang.org/t/9970 (3/5)
https://forum.nim-lang.org/t/9989 (3/12)
Following The Roadmap 2023 for community building , you could join us in the matrix space where we discuss how to build a community. We appreciate doable suggestions and helps, such as improving the workflow, implementing the roadmap, suggesting doable tasks, reviewing code from contributors. United we stand. We shall work together to make the community thrive.
Many thanks to @Yepoleb, @lenis0012, @pietroppeter, @Clonkk, @mode80, @Phil, @CxPlanner, @shirleyquirk, @elcritch, @geotre, @thinkwelltwd, @xrfez, @enthus1ast, @piertoni, @Dnanilem for sponsoring me on GitHub.