-
-
Notifications
You must be signed in to change notification settings - Fork 930
Description
Bug report
If I have a property of type class-string<Model&One&Two&Three>
and try to assign a class string of a Model that has previously been checked if it as instance of One, Two and Three, phpstan reports the type for the Model to be class-string<Model>&class-string<One>&class-string<Three>&class-string<Two>
.
Code snippet that reproduces the problem
https://phpstan.org/r/d90507d3-8e31-456b-85fe-56e9571aabc6
Expected output
I would expect the outcome to be class-string<Model&One&Two&Three>
instead of class-string<Model>&class-string<One>&class-string<Three>&class-string<Two>
.
I also had a variation of this reporting where the code is practically the same, but phpstan inferred the type class-string<Model>|class-string<One>|class-string<Three>|class-string<Two>
instead. I cannot tell why the playground gives a different result - but both results appear wrong to me.