class E {}
/**
* @template T of E
*/
class R {
/** @var T */
public $e;
/** @return T */
function ret() { return $this->e; } // nonsense, to silence missing return
function test(): void {
$this->e = static::ret(); // not ok
$this->e = self::ret(); // not ok
$this->e = $this->ret(); // ok
}
}
Property R<T of E>::$e (T of E) does not accept E.