Conversation
Complete L60 by resolving relation-name variables, unions, and relation objects through the shared type engine. Retain custom builders for relation shortcuts and concrete relations for direct eager callbacks. Cover callback types, completion, diagnostics, navigation, and Laravel runtime behavior. Keep this follow-up separate from L59.
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This branch has not been deployed
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.
Relation callbacks lost their related model when the relation came from a variable, a union of names, or a relation object. Complete L60 by resolving the argument through the shared type engine and retaining each related model's custom builder. Apply the same inference to relation shortcuts and direct
Builder::with()callbacks.Reuse the existing argument binder, cached relation-chain resolver, and ancestor template projection. Custom relation subclasses can reorder or fix their generic parameters; eager callbacks preserve concrete relations, and morph callbacks retain their second parameter. Unknown eager names keep the declared callback type.
Adds 19 type assertions (113 total), 13 completion/diagnostic cases with positive and negative member checks, navigation tests, Laravel demos, and 13 runtime checks (217 total). The fixture includes Laravel's separate static
Model::with($relations)declaration; the direct two-argument callback form is tested throughquery()->with()to match runtime behavior.Stack: depends on #452 (L59), above #451, #450, #449, #448, and #447. This follow-up PR targets upstream
main, so its diff includes the unmerged dependencies. The final commit contains L60; merge the dependencies first. L59 is unchanged.Validation: full
cargo test(14,837 passed),cargo clippy --fix --allow-dirty -- -D warnings,cargo clippy --all-targets -- -D warnings,cargo fmt --check, PHP syntax/runtime checks, and Laravel analysis with exactly the three intentional diagnostics.