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

Use intersection types #10118

Closed
greg0ire opened this issue Oct 10, 2022 · 3 comments · Fixed by #10255
Closed

Use intersection types #10118

greg0ire opened this issue Oct 10, 2022 · 3 comments · Fixed by #10255
Milestone

Comments

@greg0ire
Copy link
Member

The plan is to wait for a merge up between Psalm 4.x and master and switch all branches to Psalm master branch, and use intersection types.

Originally posted by @greg0ire in #10084 (comment)

@greg0ire greg0ire added this to the 3.0.0 milestone Oct 10, 2022
greg0ire added a commit to greg0ire/doctrine-orm that referenced this issue Nov 26, 2022
It is not stable yet, but should be good enough, and this will help
taking care of doctrine#10118

Let us baseline all the new issues, just because they are new does not
mean they are more important than already-baselined errors. Besides, it
is more important to have higher standards for new code than to get an
increased baseline.
greg0ire added a commit to greg0ire/doctrine-orm that referenced this issue Nov 26, 2022
It is not stable yet, but should be good enough, and this will help
taking care of doctrine#10118

Let us baseline all the new issues, just because they are new does not
mean they are more important than already-baselined errors. Besides, it
is more important to have higher standards for new code than to get an
increased baseline.
@greg0ire
Copy link
Member Author

greg0ire commented Nov 26, 2022

Ugh, I'm getting another crash now:

Target PHP version: 8.1 (set by config file) Extensions enabled:  (unsupported extensions: ctype)
Scanning files...
Uncaught InvalidArgumentException: Could not get class storage for doctrine\common\collections\selectable in /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php:48
Stack trace:
#0 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Type.php(917): Psalm\Internal\Provider\ClassLikeStorageProvider->get()
#1 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Type.php(848): Psalm\Type::mayHaveIntersection()
#2 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Type.php(704): Psalm\Type::intersectAtomicTypes()
#3 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/Reflector/TypeHintResolver.php(113): Psalm\Type::intersectUnionTypes()
#4 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php(441): Psalm\Internal\PhpVisitor\Reflector\TypeHintResolver::resolve()
#5 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php(236): Psalm\Internal\PhpVisitor\Reflector\FunctionLikeNodeScanner->start()
#6 /home/greg/dev/doctrine-orm/major/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(200): Psalm\Internal\PhpVisitor\ReflectorVisitor->enterNode()
#7 /home/greg/dev/doctrine-orm/major/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(114): PhpParser\NodeTraverser->traverseArray()
#8 /home/greg/dev/doctrine-orm/major/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(223): PhpParser\NodeTraverser->traverseNode()
#9 /home/greg/dev/doctrine-orm/major/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(114): PhpParser\NodeTraverser->traverseArray()
#10 /home/greg/dev/doctrine-orm/major/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(223): PhpParser\NodeTraverser->traverseNode()
#11 /home/greg/dev/doctrine-orm/major/vendor/nikic/php-parser/lib/PhpParser/NodeTraverser.php(91): PhpParser\NodeTraverser->traverseArray()
#12 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Internal/Scanner/FileScanner.php(88): PhpParser\NodeTraverser->traverse()
#13 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(582): Psalm\Internal\Scanner\FileScanner->scan()
#14 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(810): Psalm\Internal\Codebase\Scanner->scanFile()
#15 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(452): Psalm\Internal\Codebase\Scanner->scanAPath()
#16 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Internal/Codebase/Scanner.php(305): Psalm\Internal\Codebase\Scanner->scanFilePaths()
#17 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Codebase.php(503): Psalm\Internal\Codebase\Scanner->scanFiles()
#18 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Internal/Analyzer/ProjectAnalyzer.php(662): Psalm\Codebase->scanFiles()
#19 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/src/Psalm/Internal/Cli/Psalm.php(375): Psalm\Internal\Analyzer\ProjectAnalyzer->check()
#20 /home/greg/dev/doctrine-orm/major/vendor/vimeo/psalm/psalm(9): Psalm\Internal\Cli\Psalm::run()
#21 /home/greg/dev/doctrine-orm/major/vendor/bin/psalm(120): include('...')
#22 {main}
(Psalm 5.0.0-rc1@8f39de9001c995eb203cee3399307570f322076a crashed due to an uncaught Throwable)

@greg0ire
Copy link
Member Author

I also get it with Psalm's master branch.

@greg0ire
Copy link
Member Author

I filed vimeo/psalm#8772

@greg0ire greg0ire linked a pull request Dec 4, 2022 that will close this issue
@greg0ire greg0ire closed this as completed Dec 4, 2022
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 a pull request may close this issue.

1 participant