fixed some more inference bugs

This commit is contained in:
sergeych committed 2026-04-20 12:23:17 +03:00
1 parent a8f73dc8bd
commit 6ba128f7ba
2 files changed
+15 -6

No files matched your search

@@ -2096,12 +2096,19 @@ class Compiler(
plan.captureOwners[name] = slotLoc
plan.captures += capture
if (!plan.slotPlan.slots.containsKey(name)) {
val newSlot = plan.slotPlan.nextIndex
plan.slotPlan.slots[name] = SlotEntry(
plan.slotPlan.nextIndex,
newSlot,
isMutable = slotLoc.isMutable,
isDelegated = slotLoc.isDelegated
)
plan.slotPlan.nextIndex += 1
slotTypeByScopeId[slotLoc.scopeId]?.get(slotLoc.slot)?.let { cls ->
slotTypeByScopeId.getOrPut(plan.slotPlan.id) { mutableMapOf() }[newSlot] = cls
}
slotTypeDeclByScopeId[slotLoc.scopeId]?.get(slotLoc.slot)?.let { decl ->
slotTypeDeclByScopeId.getOrPut(plan.slotPlan.id) { mutableMapOf() }[newSlot] = decl
}
}
}
@@ -10346,6 +10353,9 @@ class Compiler(
if (initClass != null) {
classFieldTypesByName.getOrPut(declaringClassNameCaptured) { mutableMapOf() }[name] = initClass
}
if (!isDelegate && varTypeDecl is TypeDecl.Generic) {
classMemberTypeDeclByName.getOrPut(declaringClassNameCaptured) { mutableMapOf() }[name] = varTypeDecl
}
}
// Emit MiniValDecl for this declaration (before execution wiring), attach doc if any