feat: resolve the object pseudo-type and Closure type-hint#467
Open
chadmandoo wants to merge 2 commits into
Open
feat: resolve the object pseudo-type and Closure type-hint#467chadmandoo wants to merge 2 commits into
chadmandoo wants to merge 2 commits into
Conversation
chadmandoo
added a commit
to chadmandoo/elephc
that referenced
this pull request
Jul 10, 2026
…4/#593, illegalstudio#467) v0.26.1 rejected `Closure` and `object` type-hints as "Unknown type". Re-ports the illegalstudio#467 resolution (88% → 90%, 269 → 277/307): - `object` pseudo-type resolves to Mixed (elephc has no classless-object variant; Mixed boxes any value, objects included). name_resolver keeps it unprefixed; pointers.rs resolves it. - `Closure` class-name type-hint resolves to Callable (closures resolve to Callable internally) for params, returns, AND properties. PHP forbids the bare `callable` pseudo-type as a property type but PERMITS the `Closure` spelling, so resolve_declared_property_type_hint lets `Closure` through the callable restriction via type_expr_names_closure (a bare `callable` property still rejected). Clears the `Unknown type: Closure` + `Unknown type: <FQCN>` (object) family (8). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
fa272ce to
c117052
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two name-resolution completeness fixes for type positions: the
objectbuilt-in pseudo-type resolved as a namespaced class name ("Unknown type: App\object"), and theClosuretype-hint was unrecognized in param/return/property positions.objectmaps to the top object type;Closuremaps to the callable representation but stays permitted as a PROPERTY type (PHP allows a Closure-typed property while forbidding barecallablethere). Byte-parity vs PHP 8.5 + regression test.