Skip to content

fix(codegen): call final-class methods directly - #2065

Merged
nahime0 merged 8 commits into
mainfrom
perf/final-class-method-calls
Oct 25, 2026
Merged

nahime0 merged 8 commits into
mainfrom
perf/final-class-method-calls

Conversation

@nahime0

@nahime0 nahime0 commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Calls through a non-generic final class now target the emitted implementation directly, including inherited methods. Generic variance keeps runtime body selection and literal-argument checks select the actual declaring instantiation, preserving its static storage and TypeError diagnostic name.

Tracks Code Journal task a9b89d6e.

Added assembly assertions for every supported target with IR optimization disabled, plus runtime regressions for inherited and nullable calls, references/default arguments, covariance/contravariance, full false-literal argument messages, and closure rebinding. Null-only parameter guards use typed EIR emitter inputs on all five targets, isolating the existing standalone-null parser gap. Includes an example and updated internals/PHP documentation.

The OPcache timezone fixture also compares each complete last_used string against the host date utility at the exact last_used_timestamp from the same status output. UTC, America/New_York, Europe/Paris and restoration of the PHP default to UTC remain asserted. This replaces the July-only offsets that failed after the seasonal clock change, without accepting alternative offsets, changing production behavior, adding dependencies or racing timestamps between child processes. Child-local TZ and LC_ALL=C isolate the reference; BSD/macOS and GNU/Linux argument forms are selected for their hosts. The ci:macos tier is enabled to validate the originally failing macOS CLI fixture before returning to the merge queue.

Validation: git diff --check passed and the full combined Claude static review is clean on 3b67786f329a7d9f65fba2ca5852acb8e6e5e193 (delegation 9b7ae669-b74a-4afc-a916-829c6306e1f8). No builds, tests, PHP, compilers or date oracle commands were executed locally. New CI and Greptile results must match this exact head; previous results for source 39cee8fc or merge-group d199123f do not validate this update.

@github-actions github-actions Bot added area:codegen Touches target-aware assembly or backend lowering. size:s Small pull request. type:fix Corrects broken or incompatible behavior. labels Oct 24, 2026
@greptile-apps

greptile-apps Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no new blocking issues were found.

Summary

Calls to methods on non-generic final classes now go directly to the emitted implementation, including inherited methods.

  • Calls through non-generic final classes go straight to their emitted method bodies.
  • The opcache timezone test checks each full timestamp against the host date output.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Known receiver class] --> B{Non-generic final class or final method?}
    B -->|Yes| C{Direct body available?}
    C -->|Yes| D[Call declaring implementation directly]
    C -->|No| E[Keep runtime method selection]
    B -->|No| E
Loading

Reviews (3) · Last reviewed commit: "fix(tests): compare opcache dates at the..." · Reviewed by Greptile

@github-actions github-actions Bot added size:m Medium-sized pull request. and removed size:s Small pull request. labels Oct 24, 2026
@nahime0
nahime0 added this pull request to the merge queue Oct 24, 2026
@nahime0
nahime0 removed this pull request from the merge queue due to a manual request Oct 25, 2026
@nahime0 nahime0 added the ci:macos Run the macOS test matrix and iOS links on this PR, not only in the merge queue. label Oct 25, 2026
@nahime0
nahime0 added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit cdb9a1a Oct 25, 2026
384 of 418 checks passed
@nahime0
nahime0 deleted the perf/final-class-method-calls branch October 25, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:codegen Touches target-aware assembly or backend lowering. ci:macos Run the macOS test matrix and iOS links on this PR, not only in the merge queue. size:m Medium-sized pull request. type:fix Corrects broken or incompatible behavior.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant