Skip to content

Commit ecec2d9

Browse files
committed
fix
1 parent f9d2bcd commit ecec2d9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/Type/MixedType.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
use PHPStan\Type\Traits\NonGeneralizableTypeTrait;
3838
use PHPStan\Type\Traits\NonGenericTypeTrait;
3939
use PHPStan\Type\Traits\UndecidedComparisonCompoundTypeTrait;
40+
use function get_class;
4041
use function sprintf;
4142

4243
/** @api */
@@ -310,11 +311,7 @@ public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope)
310311

311312
public function equals(Type $type): bool
312313
{
313-
if (!$type instanceof self) {
314-
return false;
315-
}
316-
317-
if ($type instanceof ErrorType) {
314+
if (get_class($type) !== static::class) {
318315
return false;
319316
}
320317

tests/PHPStan/Generics/TemplateTypeFactoryTest.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ public function dataCreate(): array
5454
null,
5555
TemplateTypeVariance::createInvariant(),
5656
),
57-
new MixedType(),
57+
TemplateTypeFactory::create(
58+
TemplateTypeScope::createWithFunction('a'),
59+
'U',
60+
null,
61+
TemplateTypeVariance::createInvariant(),
62+
),
5863
],
5964
[
6065
new UnionType([

0 commit comments

Comments
 (0)