Repository navigation
Skip tests rely on Zend MM turned on - #160
Merged
Merged
Conversation
Those two tests have expect memory exhausted fatal error
Contributor
Author
|
=.= |
heyJordanParker
added a commit
to heyJordanParker/php-sharp
that referenced
this pull request
Oct 13, 2026
…-methods feat: List contains, indexOf and last, searching by section 19's ==
heyJordanParker
added a commit
to heyJordanParker/php-sharp
that referenced
this pull request
Oct 13, 2026
…s any does
Problem
- `loose.contains("vip")` on a `List<Any?>` was refused, while `loose.any(x => x == "vip")` compiled. The search
check compared two elements of the element type, because it ran before the arguments were analyzed and the
value's type was not known yet. Spec section 12 means `contains(value)` is `any(e => e == value)`, so the two
must agree.
- `remove` takes the receiver-before-value rule from php#160's merge, and no test lowered a `remove` whose receiver
runs code.
Solution
- `analyze_method_call` runs `check_element_equality` after `analyze_invocation_targets`, with the value's type.
`check_element_equality` refuses what `element == value` refuses: `sharp_refusal` on the element type and the
value's type, and `check_comparison_operand` for an `Any` element against the value's type.
- A value that is no element is refused by its argument check, so the search check runs only when the value's
type is contained by the element type. It no longer reports a second issue on `sizes.contains("a")`.
- `display_refused_side` names the class part of either side, as `report_sharp_refusal` already did with its own
closure, which it now calls.
- `a_list_search_runs_its_receiver_before_its_value` gains the row `this.bumped().items.remove(this.n)`.
crates/
analyzer/
src/expression/
binary/comparison.rs check_element_equality takes value_type; display_refused_side, shared with
report_sharp_refusal
call/method_call.rs runs the search check once the arguments are analyzed, for a value that fits
tests/sharp.rs a_search_needs_equality_on_the_element_type: contains and any agree on
List<Any?> given a string, given an Any?, and on List<Line> given a Line
sharp-bridge/
tests/lower.rs a_list_search_runs_its_receiver_before_its_value: the remove row
heyJordanParker
added a commit
to heyJordanParker/php-sharp
that referenced
this pull request
Oct 13, 2026
Problem patch-coverage failed a pull request on an impossible match arm, since no test can run an unreachable!(…) call. #[coverage(off)] leaves out a whole function, too much for one arm. So builders reshaped the code to pass: php#160 folded three impossible Refusal cases into a real arm behind debug_assert!, and moved an unreachable! onto a line that runs. Agents copy what the tree shows, so the workaround spreads. Solution As coverage.py's exclude_lines leaves out `raise NotImplementedError`, the job drops the lcov records of every line that holds `unreachable!(` before diff-cover reads them. cargo-llvm-cov has no line exclusion, so an awk step filters lcov.info into reachable.info. It drops a line's DA record and its FN record, since diff-cover scores a closure such as `|| unreachable!(…)` from FN when the line has no DA. The failure message names both exclusions. .github/workflows/ci.yml <- patch-coverage: the awk step, diff-cover reads reachable.info, the message names unreachable!(…)
heyJordanParker
added a commit
to heyJordanParker/php-sharp
that referenced
this pull request
Oct 13, 2026
Problem: PR php#152 must be up to date with master, and master gained php#160, the List and Map collection methods, after the last merge. Solution: merge master. Git merged every file on its own. The analyzer, semantics and bridge suites pass on the merged tree. crates/ ├── analyzer/src/expression/call/method_call.rs both sides kept ├── analyzer/tests/sharp.rs both sides' tests kept ├── names/src/lib.rs master's change └── sharp-bridge/ ├── src/lower.rs both sides kept ├── src/lower/types.rs both sides kept └── tests/lower.rs both sides' tests kept
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.
Those two tests have expect memory exhausted fatal error.
These two tests will failed when in memory check mode in 32bit system.