Identified root cause of SocketBox bug - local variable clone issue

Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-14 07:51:06 +00:00
parent 1bcd425edb
commit 5730d2fa0f
2 changed files with 50 additions and 6 deletions

View File

@ -328,6 +328,18 @@ impl NyashInterpreter {
// オブジェクトを評価(通常のメソッド呼び出し)
let obj_value = self.execute_expression(object)?;
// Debug: Print object type and Box ID for SocketBox debugging
if method == "bind" || method == "listen" || method == "isServer" {
println!("🔍 DEBUG: Method '{}' called on object type: {} (Box ID: {})",
method,
obj_value.type_name(),
if let Some(socket_box) = obj_value.as_any().downcast_ref::<SocketBox>() {
socket_box.box_id().to_string()
} else {
"N/A".to_string()
});
}
// StringBox method calls
if let Some(string_box) = obj_value.as_any().downcast_ref::<StringBox>() {
return self.execute_string_method(string_box, method, arguments);