Skip to content

Commit bb5ef62

Browse files
committed
Fix test
1 parent ed2c0d2 commit bb5ef62

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

e2e/bug-11857/src/test.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function user(): BelongsTo
5757
/** @return BelongsTo<User, self> */
5858
public function user2(): BelongsTo
5959
{
60+
/** @phpstan-ignore return.type */
6061
return $this->belongsTo(User::class);
6162
}
6263
}
@@ -65,5 +66,5 @@ function test(ChildPost $child): void
6566
{
6667
assertType('Bug11857\BelongsTo<Bug11857\User, Bug11857\ChildPost>', $child->user());
6768
// This demonstrates why `$this` is needed in non-final models
68-
assertType('Bug11857\BelongsTo<Bug11857\User, Bug11857\ChildPost>', $child->userSelf());
69+
assertType('Bug11857\BelongsTo<Bug11857\User, Bug11857\Post>', $child->userSelf()); // should be: Bug11857\BelongsTo<Bug11857\User, Bug11857\ChildPost>
6970
}

0 commit comments

Comments
 (0)