No error on use of `unsafe_cast`
[hiphop-php.git] / hphp / hack / test / typecheck / trait_bug.php
blobb2d33aa807e4f340e7b4cb164238978454c31536
1 <?hh // strict
2 // Copyright 2004-present Facebook. All Rights Reserved.
4 abstract class QSIC extends QIC<this::TCoerced> {
5 abstract const type TCoerced as nonnull;
8 <<__ConsistentConstruct>>
9 trait TQSIC {
11 require extends QSIC;
12 require extends QIC<this::TCoerced>;
14 private function __construct() {}
16 final public static function nonNullable(): this {
17 return new static();
20 final public static function nullable(
21 ): GNIC<this::TCoerced> {
22 return new GNIC(static::nonNullable());
26 final class GNIC<TInner as nonnull>
27 extends QIC<?TInner> {
29 public function __construct(
30 private QIC<TInner> $innerCoercer,
31 ) {}
34 abstract class QIC<+TCoerced> {}