mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-09-06 08:16:02 +00:00
Replace the sequential Tier 2b/2a propagation with a unified fixpoint loop that handles four binding kinds: callResult, copy, fieldAccess, and methodCallResult. The loop iterates until no new bindings are produced (max 10 iterations), enabling arbitrary-depth mixed chains: const user = getUser(); // callResult → User const addr = user.address; // fieldAccess → Address const city = addr.getCity(); // methodCallResult → City city.save(); // resolves to City#save Infrastructure: - PendingAssignment union extended with fieldAccess and methodCallResult - resolveFieldType helper: typeName → class nodeId → lookupFieldByOwner - resolveMethodReturnType helper: typeName → class nodeId → lookupFuzzyCallable filtered by ownerId - Fixpoint also resolves reverse-order copy chains that single-pass missed Languages: TS, JS, Java, Kotlin, C#, Go, Rust, Python, PHP, Ruby, C++. Each gets field access and/or method-call-with-receiver detection in extractPendingAssignment, plus method-chain-binding test fixtures.
28 lines
653 B
PHP
28 lines
653 B
PHP
<?php
|
|
|
|
class City {
|
|
public string $name;
|
|
public function __construct(string $name) { $this->name = $name; }
|
|
public function save(): bool { return true; }
|
|
}
|
|
|
|
class Address {
|
|
public City $city;
|
|
public function __construct(City $city) { $this->city = $city; }
|
|
public function getCity(): City { return $this->city; }
|
|
}
|
|
|
|
class User {
|
|
public Address $address;
|
|
public function __construct(Address $address) { $this->address = $address; }
|
|
}
|
|
|
|
function getUser(): User {
|
|
return new User(new Address(new City("NYC")));
|
|
}
|
|
|
|
function processChain(): void {
|
|
$user = getUser();
|
|
$city = $user->getCity();
|
|
$city->save();
|
|
}
|