Skip to content

fix: stop classifying mixed as scalar - #210

Merged
calebdw merged 1 commit into
PHPantom-dev:mainfrom
calebdw:calebdw/push-qywsktylpzlm
Jul 9, 2026
Merged

fix: stop classifying mixed as scalar#210
calebdw merged 1 commit into
PHPantom-dev:mainfrom
calebdw:calebdw/push-qywsktylpzlm

Conversation

@calebdw

@calebdw calebdw commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

is_scalar_name() incorrectly treated mixed as a scalar. That leaked into extract_value_type(skip_scalar=true), where array accesses on array<string, mixed> dropped the element type entirely. As a result, expressions like true ? $body['key'] : null resolved to null instead of mixed|null, producing false type_mismatch_argument diagnostics.

This PR fixes the root cause by stopping mixed from being classified as scalar, rather than special-casing the extractor. Because that change also affected unknown-member diagnostics, the resolver now keeps mixed in the "untyped / cannot verify" bucket there instead of treating it like an unloadable class name.

Fixes #206

@calebdw
calebdw force-pushed the calebdw/push-qywsktylpzlm branch from d52dfd7 to 59fd673 Compare July 9, 2026 13:44
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@calebdw
calebdw force-pushed the calebdw/push-qywsktylpzlm branch from 59fd673 to 66ba190 Compare July 9, 2026 14:47
@calebdw calebdw changed the title fix: preserve mixed element type in array access extraction fix: stop classifying mixed as scalar Jul 9, 2026
@calebdw
calebdw force-pushed the calebdw/push-qywsktylpzlm branch from 66ba190 to 19e5284 Compare July 9, 2026 15:00
@calebdw
calebdw force-pushed the calebdw/push-qywsktylpzlm branch from 19e5284 to b5dfb65 Compare July 9, 2026 15:04
@calebdw
calebdw merged commit 745059c into PHPantom-dev:main Jul 9, 2026
7 checks passed
@calebdw
calebdw deleted the calebdw/push-qywsktylpzlm branch July 9, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong Type For Ternary Expression

2 participants