#3416

SC8011: static members on native subclass of island class still refused (blocks clipanion's static paths idiom)

Openespetroopened 4d ago

Summary

static members on a native class extending an island-owned class are still refused:

error SC8011: a native class extending a class owned by a Node island cannot have static members yet

Native subclasses of island classes otherwise work now (constructors, instance methods) — only statics, decorators, parameter properties, and private/computed names remain refused (islandSubclassRefusal in lower-node-island.ts).

This keeps clipanion idiomatic usage broken on main: static paths = [['greet']] is how every clipanion Command declares routing, so the island build fails; the compiler then falls back to a native build whose stdout-patching fences throw at runtime (process.stdout._write patching, R2.5).

Reproduction

import { Cli, Command, Option } from "clipanion";
class Greet extends Command {
  static paths = [["greet"]];
  name = Option.String();
  async execute() { this.context.stdout.write(`hello, ${this.name}\n`); }
}
new Cli({ binaryName: "demo" }).register(Greet);

→ island compile fails SC8011 at static paths; warning SC8023; native fallback builds but the static declaration's fence throws when reached.

Verified on main (d4c82a5c3), darwin-arm64. Filing as a tracking issue for the NI-5b milestone — clipanion (6.2M weekly downloads) is the motivating case.

Activity

0

No activity yet.