Skip to content

Language: enum implements metadata in CFG/VM (#2299) - #2830

Merged
PurHur merged 1 commit into
masterfrom
fix/enum-implements-metadata-2299
May 27, 2026
Merged

PurHur merged 1 commit into
masterfrom
fix/enum-implements-metadata-2299

Conversation

@PurHur

@PurHur PurHur commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Parse enum Foo: T implements Bar in php-cfg ($implements on PHPCfg\Op\Stmt\Enum_).
  • Emit classImplements on TYPE_DECLARE_ENUM in lib/Compiler.php.
  • Store interface names on ClassEntry during VM enum registration.
  • Add patches/php-cfg-enum-implements.patch + overlay apply hook in script/apply-patches.sh.

Test plan

  • php bin/vm.php -r 'interface L {} enum S: string implements L { case A = "x"; } echo S::A;'
  • VM compliance: enum_implements_metadata.phpt (runs in VMTest data provider)
  • make bootstrap-selfhost-link (Docker)

Advances #1492 / closes slice 1 of #2299 (metadata only; enum methods deferred).

Made with Cursor

Parse `enum Foo: T implements Bar` in php-cfg, emit classImplements on
TYPE_DECLARE_ENUM, and store interfaces on ClassEntry for self-host subset v1.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit 31b5034 into master May 27, 2026
@PurHur
PurHur deleted the fix/enum-implements-metadata-2299 branch May 27, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant