Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix too early inference of Encapsed string #3585

Open
wants to merge 1 commit into
base: 1.12.x
Choose a base branch
from

Conversation

VincentLanglet
Copy link
Contributor

@VincentLanglet VincentLanglet commented Oct 26, 2024

@@ -1129,9 +1129,6 @@ private function resolveType(string $exprString, Expr $node): Type
}

$resultType = $this->initializerExprTypeResolver->resolveConcatType($resultType, $partType);
if (count($resultType->getConstantStrings()) === 0) {
Copy link
Contributor Author

@VincentLanglet VincentLanglet Oct 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will still need to check every part to see if it's a lowercase string.

I'm unsure I should change this to

if (count($resultType->getConstantStrings()) === 0 && $resultType->isLowercaseString()->no()) {

to avoid a similar bug to come back if we introduce another string Accessory.

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.

1 participant