Skip to content

Language: Traits, abstract classes, and interfaces #144

@PurHur

Description

@PurHur

Problem

Compiler.php asserts no extends/implements (#101). Traits and abstract methods are unsupported.

Goal

Single inheritance + interface method checks + horizontal trait composition (subset).

Tasks

  • Remove asserts; compile extends / implements metadata
  • Trait flattening at compile time
  • Abstract method enforcement at instantiate
  • VM dispatch table for trait precedence

Acceptance

trait T { public function f(): int { return 1; } }
class C { use T; }
(new C)->f() === 1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions