Repository navigation
fix(enums): preserve trait constants and validate method modifiers - #1674
Conversation
[High impact] The reviewed changes appear safe to merge; no new blocking issue was confirmed. SummaryThe PR preserves enum trait constants, declaration order, and final method flags. It also checks enum method contracts and binds interface calls against the selected enum method. Changes since the previous review:
No new actionable findings were confirmed. The supplied previous threads are unnumbered, so they have no
Review checks were static; no tests were executed during this review.
|
e4ac2db to
0678ebb
Compare
Confidence Score: 2/5High risk Enum metadata now keeps trait constants and method modifiers, but imported constant and method semantics still diverge from PHP. Imported trait constants that use SummaryThis change feeds flattened trait constants into enum metadata, appends them after the enum's own cases and constants in reflection order, rejects constants that collide with case names, rejects methods that remain abstract, and records
Diagramflowchart LR
decls["Enum and trait declarations"] --> flatten["Trait flattening"]
flatten --> meta["Enum metadata"]
meta --> consts["Constant values and reflection order"]
meta --> mods["Abstract rejection and final flags"]
consts --> selfgap["self:: still unresolved"]
mods --> siggap["Incompatible body still accepted"]
Findings
Last reviewed commit: 0678ebb |
0678ebb to
ae75c11
Compare
ae75c11 to
b48975c
Compare
Confidence Score: 1/5[High risk] Enum metadata now keeps trait constants and checks abstract trait methods. The SummaryFlattened trait constants are copied into enum metadata,
Diagramflowchart LR
decls["Enum and trait declarations"] --> flatten["Trait flattening"]
flatten --> meta["Enum metadata"]
meta --> consts["Constant values and reflection order"]
meta --> checks["Abstract trait requirement check"]
consts --> magic["__CLASS__ still a MagicConstant"]
checks --> adapt["Raw trait method, not the adaptation"]
Findings
Earlier findings on this head:
Last reviewed commit: b48975c |
b48975c to
db4f92a
Compare
db4f92a to
559c245
Compare
|
Rebased the reviewed fixes onto main 9e7cad3 and verified publication at 559c245. The new main already carries the first-post-eval string checks and cold PDO timeout, so those were kept without duplication. The remaining scalar ownership checks retain one test per supported target. Focused post-rebase validation: all five enum trait/interface target checks, all five post-eval scalar target checks, and the three native enum-review regressions pass; cargo build and diff hygiene pass. Earlier validation of the substantive fix passed 95 native tests, 77 diagnostics, and the broader target controls, as reported above. Full CI has restarted on the exact new head, and this remains draft until it completes successfully. |
Confidence Score: 2/5[High risk] Enum metadata now keeps trait constants and checks trait and interface method contracts. The unordered transitive-interface expansion and the interface parameter-shape check need to be fixed before merging. SummaryFlattened trait constants are copied into enum metadata, lexical
Diagramflowchart LR
decls["Enum, trait, and interface declarations"] --> flatten["Trait flattening"]
flatten --> meta["Enum metadata with direct interfaces"]
meta --> walk["HashMap contract walk"]
walk --> expand["Expand one enum's interfaces"]
expand --> check["Return and signature checks"]
Findings
Earlier findings
Last reviewed commit: 559c245 |
|
@greptile review |
|
@greptile review |
|
@greptile review |
|
@greptile-apps please review the current signed head 0a9f62d. It integrates current main and fixes the independent Grok P1: a heap-result owner is now explicitly zero-initialized before publication, including store-free rejected bindings. The five-target EIR regressions fail before the fix and pass after it; focused native controls pass with IR optimization on and off. The follow-up Grok review is clean on this exact commit. |
|
@greptile-apps Please review the current head 6c82f40, including the trailing named-omission fix. The new regressions pass in both IR modes, all five target fixtures pass, and independent Grok review is clean. |
Closes #1317.
Closes #1438.
Closes #1439.
Summary
Preserve flattened trait constants, reflection declaration order and final method flags in enum metadata. Reject abstract source enum methods and enforce concrete implementations of trait and interface requirements.
The review corrections lower declaration magic constants in their lexical scope and bind trait
__CLASS__values to each consumer, preserve abstract contracts through nestedasadaptations andinsteadof, allow final enumselfreturns forstaticcontracts, and accept legal optional/extra-optional trait parameters. Signature validation excludes compiler-generated argument collectors. Explicit enum interface checks include transitive, static, visibility, parameter, return and by-reference contracts.The three reproduced macOS CI timeouts are repaired by independently scheduling the unchanged post-eval string/scalar fixtures for each target and applying the existing cold-PDO budget to the exact combined PDO/mysqli test. No test assertions or global timeout budgets were removed.
Validation
cargo build, PHP example syntax andgit diff --checkpass.6db3e9a14e2a50883fb36e880650533151e881f0. Full exact-head CI remains the readiness gate.