Skip to content
This repository was archived by the owner on Sep 1, 2023. It is now read-only.

Commit 4b6ccc8

Browse files
committed
Manually modify type structure shape to get an unsupported type
Makes it possible to test on 3.12
1 parent 43ba171 commit 4b6ccc8

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

tests/TypeStructureTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,9 +265,10 @@ public function testInvalidTypes<T>(
265265

266266
public function testUnsupportedType(): void {
267267
$this->expectException(UnsupportedTypeException::class);
268-
TypeAssert::matchesTypeStructure(
269-
type_structure(C::class, 'TVec'),
270-
null,
271-
);
268+
269+
$ts = type_structure(C::class, 'TStringArray');
270+
$ts['kind'] = 20; // TypeStructureKind::OF_VEC in >= 3.17
271+
/* HH_IGNORE_ERROR[4110] invalid argument: modified $ts by hand */
272+
TypeAssert::matchesTypeStructure($ts, null);
272273
}
273274
}

tests/fixtures/TypeConstants.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,4 @@ class TypeConstants {
3737
);
3838

3939
const type TEnum = ExampleEnum;
40-
41-
/* HH_IGNORE_ERROR[2049] Unbound name unless enable_experimental_tc_features
42-
* is on */
43-
const type TVec = vec<string>;
4440
}

0 commit comments

Comments
 (0)