Error on self::class on non final classes
[hiphop-php.git] / hphp / hack / test / typecheck / nullsafe_call_on_expr_dep.php
blob662ce0f3d1aa449e898da24d22add31d184dafc7
1 //// file1.php
2 <?hh // strict
3 // Copyright 2004-present Facebook. All Rights Reserved.
5 abstract class A {
6 public function f(): ?this {
7 return $this;
11 abstract class B extends A {
12 public function g(): void {}
15 /* HH_FIXME[4336] */
16 function b(): B {
19 //// file2.php
20 <?hh // strict
22 function call<Ta, Tb>(
23 Ta $x,
24 (function(Ta): Tb) $f,
25 ): Tb {
26 return $f($x);
29 function test(): void {
30 $b = call(b(), $x ==> $x->f());
31 call($b, $x ==> $x?->g());