public override void GetIntCode(BuildICCode codeManager) { RightExpression.GetIntCode(codeManager); var(x, type) = codeManager.variableManager.Peek(Id.Text); if (type is null) { type = codeManager.virtualTable.getAttrType(codeManager.variableManager.ClassName, Id.Text); } if ((RightExpression.StaticType.Text == "Int" || RightExpression.StaticType.Text == "Bool" || RightExpression.StaticType.Text == "String") && type == "Object") { codeManager.codeLines.Add(new ICPushParams(codeManager.variableManager.PeekCounter())); codeManager.codeLines.Add(new ICCallLabel(new ICLabel("_wrapper", RightExpression.StaticType.Text), codeManager.variableManager.PeekCounter())); codeManager.codeLines.Add(new ICPopParams(1)); } if (x != -1) { codeManager.codeLines.Add(new ICAssignVarToVar(x, codeManager.variableManager.PeekCounter())); } else { var offset = codeManager.virtualTable.getOffset(codeManager.variableManager.ClassName, Id.Text); codeManager.codeLines.Add(new ICAssignVarToMem(0, codeManager.variableManager.PeekCounter(), offset)); } }