Fix ctor param reassignment regression

This commit is contained in:
sergeych committed 2026-01-25 12:35:36 +03:00
1 parent 96947aac50
commit a4f41f17bf
4 files changed
+129 -1

No files matched your search

@@ -3266,7 +3266,13 @@ class Compiler(
this.currentClassCtx = cls
try {
(thisObj as? ObjInstance)?.let { i ->
annotatedFnBody.execute(ClosureScope(this, i.instanceScope))
val execScope = i.instanceScope.createChildScope(
pos = this.pos,
args = this.args,
newThisObj = i
)
execScope.currentClassCtx = cls
annotatedFnBody.execute(execScope)
} ?: annotatedFnBody.execute(thisObj.autoInstanceScope(this))
} finally {
this.currentClassCtx = savedCtx