You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4e5c736
Browse filesBrowse the repository at this point in the historyBrowse files
$contextPrefix . "Generic type argument {$expectedTypeNode} does not satisfy upper bound {$templateTag->bound} of template {$templateTag->name} in {$className}"
958
+
$contextPrefix . "Generic type argument {$expectedTypeNode} does not satisfy upper bound {$boundNode} of template {$templateTag->name} in {$className}"
Copy file name to clipboardExpand all lines: tests/TypeChecking/Generics/FBoundedPolymorphismTest.php
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -218,5 +218,15 @@ final class FBoundImpostor extends FBoundBase
218
218
$base = newFBoundDerived();
219
219
})->toThrow(TypeError::class);
220
220
});
221
+
222
+
test('reports substituted bound in diagnostic message when generic argument fails F-bound', function () {
223
+
expect(function () {
224
+
/** @var FBoundSortedList<FBoundPlain> $list */
225
+
$list = newFBoundSortedList();
226
+
})->toThrow(
227
+
TypeError::class,
228
+
'Generic type argument ' . FBoundPlain::class . ' does not satisfy upper bound ' . FBoundComparable::class . '<' . FBoundPlain::class . '> of template T in ' . FBoundSortedList::class
0 commit comments