Skip to content

Commit 69dddfd

Browse files
committed
Add todo
1 parent ab1aad1 commit 69dddfd

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

docs/todo.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,46 @@ Two pieces are needed:
261261
for template substitution, producing a union of the possible return
262262
types.
263263

264+
### 24. Namespaced class breaks `static` return type chain resolution
265+
**Priority: Medium**
266+
267+
When a class lives in a namespace and calls a static method whose return
268+
type is `Builder<static>`, the chain resolution breaks. The same code
269+
works without a namespace.
270+
271+
```php
272+
// lead_providers.php
273+
namespace Luxplus\Core\Database\Model\LeadProviders;
274+
275+
final class LeadProviders extends Model {}
276+
277+
LeadProviders::query()-> // ← no completion (works without the namespace)
278+
```
279+
280+
```php
281+
// model.php (same or separate file)
282+
abstract class Model
283+
{
284+
/** @return \Illuminate\Database\Eloquent\Builder */
285+
public static function query() {}
286+
}
287+
```
288+
289+
```php
290+
// builder.php
291+
namespace Illuminate\Database\Eloquent;
292+
293+
class Builder
294+
{
295+
public function where() {}
296+
}
297+
```
298+
299+
The generic argument in `Builder` should resolve to
300+
`LeadProviders`, giving a `Builder`, and `where()` should then be
301+
offered. With a namespace present the chain breaks, likely because the
302+
FQN resolution of `Model` when a namespace is involved.
303+
264304
---
265305

266306
## Go-to-Definition Gaps

0 commit comments

Comments
 (0)