resolve HH\this in TypeStructure for type constants
[hiphop-php.git] / hphp / runtime / base / type-structure.h
blobb1d2563221ebac73dc5c1815fe4f5008f2bd0c19
1 /*
2 +----------------------------------------------------------------------+
3 | HipHop for PHP |
4 +----------------------------------------------------------------------+
5 | Copyright (c) 2010-2015 Facebook, Inc. (http://www.facebook.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 3.01 of the PHP license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.php.net/license/3_01.txt |
11 | If you did not receive a copy of the PHP license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@php.net so we can mail you a copy immediately. |
14 +----------------------------------------------------------------------+
17 #ifndef incl_HPHP_TYPE_STRUCTURE_H
18 #define incl_HPHP_TYPE_STRUCTURE_H
20 #include <cstdint>
22 namespace HPHP {
24 struct String;
25 struct ArrayData;
26 struct Class;
28 /* Utility for representing full type information in the runtime. */
29 namespace TypeStructure {
31 // These values are exposed to the user in
32 // hphp/runtime/ext/reflection/ext_reflection-TypeInfo.php
33 enum class Kind : uint8_t {
34 T_void = 0,
35 T_int = 1,
36 T_bool = 2,
37 T_float = 3,
38 T_string = 4,
39 T_resource = 5,
40 T_num = 6,
41 T_arraykey = 7,
42 T_noreturn = 8,
43 T_mixed = 9,
44 T_tuple = 10,
45 T_fun = 11,
46 T_array = 12,
47 T_typevar = 13, // corresponds to user OF_GENERIC
48 T_shape = 14,
50 // These values are only used after resolution in ext_reflection.cpp
51 T_class = 15,
52 T_interface = 16,
53 T_trait = 17,
54 T_enum = 18,
56 /* TODO(7657500): the following kinds needs alias resolution, and
57 * are not exposed to the users. Could resolve to a class, enum,
58 * interface, or alias. */
59 T_unresolved = 101,
60 T_typeaccess = 102,
61 T_xhp = 103,
64 String toString(const ArrayData* arr);
66 ArrayData* resolve(ArrayData* arr, const Class* typeCstCls);
72 #endif