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 generic object comparison to use template constraint as default. #8069

Merged
merged 2 commits into from Jun 8, 2022

Conversation

AndrolGenhald
Copy link
Collaborator

Fixes #8068.

@AndrolGenhald AndrolGenhald added the release:fix The PR will be included in 'Fixes' section of the release notes label Jun 8, 2022
Comment on lines +1142 to +1152
$class_storage = $codebase->classlike_storage_provider->get($input_type_part->value);

$container_class = $container_type_part->value;

if (strtolower($input_type_part->value) === strtolower($container_type_part->value)) {
$input_type_params = $class_storage->getClassTemplateTypes();
} elseif (!empty($class_storage->template_extended_params[$container_class])) {
$input_type_params = array_values($class_storage->template_extended_params[$container_class]);
} else {
$input_type_params = array_fill(0, count($class_storage->template_types ?? []), Type::getMixed());
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This will conflict with #8044 when both are merged to master, this one is correct.

@orklah orklah merged commit b113d77 into vimeo:4.x Jun 8, 2022
@orklah
Copy link
Collaborator

orklah commented Jun 8, 2022

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix The PR will be included in 'Fixes' section of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

class-string false positive for constrained template
2 participants