-
-
Notifications
You must be signed in to change notification settings - Fork 934
Closed
phpstan/phpstan-src
#1001Description
Bug report
follow #6575 (reply in thread)
a) returning Field for expected Field2 does emit an error since level 3
b) returning Field for expected template of Field2 does NOT emit an error until level 7
c) returning Field for expected template of Field does NOT emit an error until level 7
I agree the c) example needs a compromise (fixed in phpstan rel. v1.4.6), but the b) one is clearly not consistent vs. non-template a).
Code snippet that reproduces the problem
https://phpstan.org/r/24ccc414-b3e2-4c7a-b2fe-d02b34722f92
Expected output
Template base interface/class check is consistent with simple type, eg. both checked at level 3.
Method HelloWorldTemplated::getField() should return Field2 but returns Field.
Method HelloWorldSimple::getField() should return Field2 but returns Field.
Metadata
Metadata
Assignees
Labels
No labels