3 * Copyright (c) 2014, Facebook, Inc.
6 * This source code is licensed under the MIT license found in the
7 * LICENSE file in the "hack" directory of this source tree.
12 interface DataTypeImplProvider
<Timpl
> {
13 public function impl(): Timpl
;
16 interface DataType
<Tk
, Tv
, Timpl
>
17 extends DataTypeImplProvider
<Timpl
> {
19 public function get(Tk
$id): Tv
;
22 abstract class AbstractDataType
<Tk
, Tv
> implements DataTypeImplProvider
<this
> {
23 final static public function at(): DataType
<Tk
, Tv
, this
> {
24 invariant_violation('');
27 final public function impl(): this
{
32 class MyThingDataType
extends AbstractDataType
<int, string> {
33 public function get(int $v): string {
37 public function customMethod(): void
{
41 function myFunc(): string {
42 MyThingDataType
::at()->impl()->customMethod();
43 return MyThingDataType
::at()->get(1);