Skip to content

test covered by psalm#1

Draft
sasezaki wants to merge 1 commit into5.5.xfrom
psalm-tests
Draft

test covered by psalm#1
sasezaki wants to merge 1 commit into5.5.xfrom
psalm-tests

Conversation

@sasezaki
Copy link
Owner

No description provided.

@sasezaki
Copy link
Owner Author

😢

./vendor/bin/psalm --debug --php-version=8.1.0

would show

Deep scanning /home/sasezaki/dev/BetterReflection/test/unit/Fixture/PHP81ClassForSourceStubber.php
Uncaught UnexpectedValueException: Intersection types not yet supported in /home/sasezaki/dev/BetterReflection/vendor/vimeo/psalm/src/Psalm/Internal/PhpVisitor/Reflector/FunctionLikeNodeScanner.php:427
Stack trace:

@sasezaki
Copy link
Owner Author

vimeo/psalm#7454

native intersection types support is available on master.

so, test on psalm.dev

<?php

namespace Roave\BetterReflectionTest\Fixture;

use ArrayIterator;
use stdClass;

class PHP81ClassForSourceStubber
{
    public final const FINAL_CONST = 'finalConst';

    public readonly int $readOnly;

    public function getIntersectionType(): ArrayIterator&stdClass
    {
    }
}

https://psalm.dev/r/2d9f1d25d8

Psalm runner output: 

Internal Psalm error on line 46 - /vendor/vimeo/psalm/src/Psalm/Internal/Provider/ClassLikeStorageProvider.php: Could not get class storage for arrayiterator

😿

@sasezaki sasezaki changed the title covered test by psalm test covered by psalm Jun 11, 2022
@sasezaki
Copy link
Owner Author

test/unit/Fixture/PHP81ClassForSourceStubber.php is just stub. so it should be add as stub file.

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