Skip to content

Type Narrowing caused by Type\instance_of #7

@bendavies

Description

@bendavies

Hi,

Given a variable that the type is already known:

$foo = Type\instance_of(BarInterface::class)->assert($foo);
$foo = Type\instance_of(FooInterface::class)->assert($foo);

Then type of $foo will become FooInterface, but I would expect BarInterface&FooInterface

What do you think?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions