Skip to content

Commit 3ac44b9

Browse files
committed
bypass(NIM-BUG): compiles(<macroCall>) that changes macrocache will take effect
1 parent 8fd04c2 commit 3ac44b9

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/pylib/pysugar/class.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
import ./stmt/class
3-
export class.new
3+
export class.new, class.init_subclass
44
import ./parserWithCfg
55

66
macro classAux(obj, body: untyped, topLevel: static[bool]): untyped =

src/pylib/pysugar/stmt/class.nim

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -527,11 +527,7 @@ so if wantting the attr inherited from SupCls, just write it as-is (e.g. `self.a
527527
dunderDirId.exportIfTop, dunderDirVal
528528
)
529529
let initSub = newCall("init_subclass").add initSubClassArgs
530-
result.add nnkWhenStmt.newTree(
531-
nnkElifBranch.newTree(newCall("compiles", initSub),
532-
initSub
533-
)
534-
)
530+
result.add initSub
535531

536532
discard parser.classes.pop()
537533
# Echo generated code

0 commit comments

Comments
 (0)