|
20 | 20 |
|
21 | 21 | namespace HPHP {
|
22 | 22 |
|
| 23 | +namespace { |
| 24 | + |
23 | 25 | ///////////////////////////////////////////////////////////////////////////////
|
24 | 26 | // Static asserts.
|
25 | 27 |
|
@@ -191,6 +193,79 @@ static_assert(!isNullType(KindOfString), "");
|
191 | 193 | static_assert(!isNullType(KindOfObject), "");
|
192 | 194 | static_assert(!isNullType(KindOfResource), "");
|
193 | 195 |
|
| 196 | +static_assert(isRealType(KindOfUninit), ""); |
| 197 | +static_assert(isRealType(KindOfNull), ""); |
| 198 | +static_assert(isRealType(KindOfArray), ""); |
| 199 | +static_assert(isRealType(KindOfPersistentArray), ""); |
| 200 | +static_assert(isRealType(KindOfVArray), ""); |
| 201 | +static_assert(isRealType(KindOfPersistentVArray), ""); |
| 202 | +static_assert(isRealType(KindOfDArray), ""); |
| 203 | +static_assert(isRealType(KindOfPersistentDArray), ""); |
| 204 | +static_assert(isRealType(KindOfVec), ""); |
| 205 | +static_assert(isRealType(KindOfPersistentVec), ""); |
| 206 | +static_assert(isRealType(KindOfDict), ""); |
| 207 | +static_assert(isRealType(KindOfPersistentDict), ""); |
| 208 | +static_assert(isRealType(KindOfKeyset), ""); |
| 209 | +static_assert(isRealType(KindOfPersistentKeyset), ""); |
| 210 | +static_assert(isRealType(KindOfBoolean), ""); |
| 211 | +static_assert(isRealType(KindOfInt64), ""); |
| 212 | +static_assert(isRealType(KindOfDouble), ""); |
| 213 | +static_assert(isRealType(KindOfPersistentString), ""); |
| 214 | +static_assert(isRealType(KindOfString), ""); |
| 215 | +static_assert(isRealType(KindOfObject), ""); |
| 216 | +static_assert(isRealType(KindOfResource), ""); |
| 217 | + |
| 218 | +static_assert(dt_with_rc(KindOfArray) == KindOfArray, ""); |
| 219 | +static_assert(dt_with_rc(KindOfPersistentArray) == KindOfArray, ""); |
| 220 | +static_assert(dt_with_rc(KindOfVArray) == KindOfVArray, ""); |
| 221 | +static_assert(dt_with_rc(KindOfPersistentVArray) == KindOfVArray, ""); |
| 222 | +static_assert(dt_with_rc(KindOfDArray) == KindOfDArray, ""); |
| 223 | +static_assert(dt_with_rc(KindOfPersistentDArray) == KindOfDArray, ""); |
| 224 | +static_assert(dt_with_rc(KindOfString) == KindOfString, ""); |
| 225 | +static_assert(dt_with_rc(KindOfPersistentString) == KindOfString, ""); |
| 226 | +static_assert(dt_with_rc(KindOfVec) == KindOfVec, ""); |
| 227 | +static_assert(dt_with_rc(KindOfPersistentVec) == KindOfVec, ""); |
| 228 | +static_assert(dt_with_rc(KindOfDict) == KindOfDict, ""); |
| 229 | +static_assert(dt_with_rc(KindOfPersistentDict) == KindOfDict, ""); |
| 230 | +static_assert(dt_with_rc(KindOfKeyset) == KindOfKeyset, ""); |
| 231 | +static_assert(dt_with_rc(KindOfPersistentKeyset) == KindOfKeyset, ""); |
| 232 | + |
| 233 | +static_assert(dt_modulo_persistence(KindOfPersistentArray) == KindOfArray, ""); |
| 234 | +static_assert(dt_modulo_persistence(KindOfArray) == KindOfArray, ""); |
| 235 | +static_assert(dt_modulo_persistence(KindOfPersistentVArray) == KindOfVArray, ""); |
| 236 | +static_assert(dt_modulo_persistence(KindOfVArray) == KindOfVArray, ""); |
| 237 | +static_assert(dt_modulo_persistence(KindOfPersistentDArray) == KindOfDArray, ""); |
| 238 | +static_assert(dt_modulo_persistence(KindOfDArray) == KindOfDArray, ""); |
| 239 | +static_assert(dt_modulo_persistence(KindOfPersistentString) == KindOfString, ""); |
| 240 | +static_assert(dt_modulo_persistence(KindOfString) == KindOfString, ""); |
| 241 | +static_assert(dt_modulo_persistence(KindOfPersistentVec) == KindOfVec, ""); |
| 242 | +static_assert(dt_modulo_persistence(KindOfVec) == KindOfVec, ""); |
| 243 | +static_assert(dt_modulo_persistence(KindOfPersistentDict) == KindOfDict, ""); |
| 244 | +static_assert(dt_modulo_persistence(KindOfDict) == KindOfDict, ""); |
| 245 | +static_assert(dt_modulo_persistence(KindOfPersistentKeyset) == KindOfKeyset, ""); |
| 246 | +static_assert(dt_modulo_persistence(KindOfKeyset) == KindOfKeyset, ""); |
| 247 | + |
| 248 | +static_assert(dt_with_persistence(KindOfArray) == KindOfPersistentArray, ""); |
| 249 | +static_assert(dt_with_persistence(KindOfPersistentArray) == |
| 250 | + KindOfPersistentArray, ""); |
| 251 | +static_assert(dt_with_persistence(KindOfVArray) == KindOfPersistentVArray, ""); |
| 252 | +static_assert(dt_with_persistence(KindOfPersistentVArray) == |
| 253 | + KindOfPersistentVArray, ""); |
| 254 | +static_assert(dt_with_persistence(KindOfDArray) == KindOfPersistentDArray, ""); |
| 255 | +static_assert(dt_with_persistence(KindOfPersistentDArray) == |
| 256 | + KindOfPersistentDArray, ""); |
| 257 | +static_assert(dt_with_persistence(KindOfString) == KindOfPersistentString, ""); |
| 258 | +static_assert(dt_with_persistence(KindOfPersistentString) == |
| 259 | + KindOfPersistentString, ""); |
| 260 | +static_assert(dt_with_persistence(KindOfVec) == KindOfPersistentVec, ""); |
| 261 | +static_assert(dt_with_persistence(KindOfPersistentVec) == KindOfPersistentVec, ""); |
| 262 | +static_assert(dt_with_persistence(KindOfDict) == KindOfPersistentDict, ""); |
| 263 | +static_assert(dt_with_persistence(KindOfPersistentDict) == |
| 264 | + KindOfPersistentDict, ""); |
| 265 | +static_assert(dt_with_persistence(KindOfKeyset) == KindOfPersistentKeyset, ""); |
| 266 | +static_assert(dt_with_persistence(KindOfPersistentKeyset) == |
| 267 | + KindOfPersistentKeyset, ""); |
| 268 | + |
194 | 269 | static_assert(isRefcountedType(KindOfString), "");
|
195 | 270 | static_assert(isRefcountedType(KindOfObject), "");
|
196 | 271 | static_assert(isRefcountedType(KindOfResource), "");
|
@@ -264,6 +339,9 @@ static_assert(equivDataTypes(KindOfPersistentDArray, KindOfArray), "");
|
264 | 339 | static_assert(KindOfUninit == static_cast<DataType>(0),
|
265 | 340 | "Several things assume this tag is 0, especially RDS");
|
266 | 341 |
|
| 342 | + |
| 343 | +} // namespace |
| 344 | + |
267 | 345 | ///////////////////////////////////////////////////////////////////////////////
|
268 | 346 |
|
269 | 347 | MaybeDataType get_datatype(
|
|
0 commit comments