Commit fa23fd5
disable runtime enforcement of require class constraints for mock classes
Summary:
A trait with a `require class C` constraints can only be used by class `C`, which must be final. This is enforced by HHVM when loading the class that uses the trait with the constraint.
HHVM enforcement is however too strict in presence of mock classes (see test mock.php in this diff). This diff disables HHVM enforcement for classes with the `<<__MockClass>>` attribute.
Additionally, this diff improves the error message printed when HHVM enforcement of `require class` constraints detects an error.
Reviewed By: ricklavoie
Differential Revision: D40547447
fbshipit-source-id: 56acc7e2c0a8abdb52b5d465b17b7f8b392bf1181 parent 9e8c173 commit fa23fd5
13 files changed
Lines changed: 64 additions & 11 deletions
File tree
- hphp
- runtime/vm
- test/slow/traits/requireclass
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4393 | 4393 | | |
4394 | 4394 | | |
4395 | 4395 | | |
4396 | | - | |
| 4396 | + | |
| 4397 | + | |
| 4398 | + | |
| 4399 | + | |
4397 | 4400 | | |
4398 | 4401 | | |
4399 | 4402 | | |
| |||
4403 | 4406 | | |
4404 | 4407 | | |
4405 | 4408 | | |
4406 | | - | |
| 4409 | + | |
| 4410 | + | |
| 4411 | + | |
4407 | 4412 | | |
4408 | 4413 | | |
4409 | 4414 | | |
| |||
4469 | 4474 | | |
4470 | 4475 | | |
4471 | 4476 | | |
4472 | | - | |
| 4477 | + | |
| 4478 | + | |
| 4479 | + | |
| 4480 | + | |
4473 | 4481 | | |
4474 | 4482 | | |
4475 | 4483 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
Lines changed: 22 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
0 commit comments