You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code examples on the nameof page lead to parse errors.
Standalone code, or other way to reproduce the problem
classB {}
classCextendsB {}
traitT {
requireextendsB;
publicstaticfunctionf(): void {
var_dump(nameofT); // "T"var_dump(nameofself); // "D" (user of trait)var_dump(nameofparent); // "C" (parent of trait user, not B)var_dump(nameofstatic); // "E", receiver for ::f() in main
}
}
classDextendsC { useT; }
classEextendsD {}
<<__EntryPoint>>
functionmain(): void {
E::f();
}
Steps to reproduce the behavior:
Copy-paste the above code in tmp.hack and run hhvm tmp.hack. I tested with the Docker container
Expected behavior
Code should run (or at least parse) properly.
Actual behavior
Fatal error: Encountered unexpected token `T`. in /home/tmp.hack on line 6
Environment
Operating system: macOS Sonoma 14.2.1
Installation method: Docker hhvm/hhvm:latest with sha256:1cc1be0d469a378114112096431145c9fe80612c61ba48e8697097d933147f60
HHVM Version
HipHop VM 4.172.0 (rel) (non-lowptr)
Compiler: 1667340154_989010953
Repo schema: 63eaf8b56fb7edbc7a8ca9e32786eb0c1f8f508c
Additional context
We're trying to add support for Hack syntax highlighting in Sourcegraph here: sourcegraph/sourcegraph#62770 and were going through the official docs for code examples.
The text was updated successfully, but these errors were encountered:
Describe the bug
The code examples on the nameof page lead to parse errors.
Standalone code, or other way to reproduce the problem
Steps to reproduce the behavior:
tmp.hack
and runhhvm tmp.hack
. I tested with the Docker containerExpected behavior
Code should run (or at least parse) properly.
Actual behavior
Environment
hhvm/hhvm:latest
withsha256:1cc1be0d469a378114112096431145c9fe80612c61ba48e8697097d933147f60
Additional context
We're trying to add support for Hack syntax highlighting in Sourcegraph here: sourcegraph/sourcegraph#62770 and were going through the official docs for code examples.
The text was updated successfully, but these errors were encountered: