What does EK9 error E12010 mean and how do I fix it?

← Package Capability Security · Ref: Q1277

E12010 fires when your publishable package uses a gated system type but has not declared the corresponding capability. The error message looks like:

  Error : E12010: 'Stdout' on line 14 position 16: 'Stdout' requires capability 'org.ek9.lang::Stdout': type requires declared package capability

The fix is always the same: add the required capability to the 'capabilities' list in your 'defines package' block. The error message tells you exactly which capability entry is missing.

THE SCENARIO

Your package meets all four publishable conditions (publicAccess + version + license + capabilities block), so capability enforcement is active. Somewhere in your non-dev source you reference a type that is gated — Stdout, File, TCP, EnvVars, or any other — and your capabilities list does not include it (or its primary-type grouping).

THE FIX

Add the required entry to the capabilities list. For Stdout:

  capabilities <- ["org.ek9.lang::Stdout"]

For multiple gated types, use the multi-line form:

  capabilities <- [
    "org.ek9.lang::Stdout",
    "org.ek9.lang::Stderr",
    "org.ek9.lang::File"
    ]

For grouped types, declare the primary: 'org.ek9.lang::TCP' covers TCPConnection, TCPHandler, and NetworkProperties automatically.

COMMON TRIGGERS

1. Using Stdout/Stderr/Stdin for basic I/O in a publishable library without declaring the stream capabilities.
2. Reading environment variables via EnvVars without declaring 'org.ek9.lang::EnvVars'.
3. Declaring TCPConnection as a field type instead of declaring the primary TCP capability.
4. Using File for persistence without 'org.ek9.lang::File' in the list.
5. Declaring some capabilities but missing one — each gated type needs its own entry (or its primary grouping).

EACH GATED TYPE COUNTS INDEPENDENTLY

Declaring Stdout does not cover Stderr. Declaring TCP does not cover File. The compiler reports a separate E12010 for each undeclared gated type it finds, so fixing one does not mask the others.

ALTERNATIVES TO ADDING A CAPABILITY

1. If the code that uses the gated type is actually test or fixture code, move it under a 'dev/' directory — dev code is exempt from capability enforcement (see Q1278).
2. If the package does not actually need to be publishable yet, remove one of the publishable conditions (publicAccess, version, license, or the capabilities block itself) and the enforcement will deactivate. This is the right move for local packages and experiments (see Q1275).
3. If the code shouldn't use the gated type at all — maybe an accidental Stdout in a pure-computation library — remove the usage instead of declaring the capability. The clean declaration 'this library needs no capabilities' is preserved (see Q1276).

See Q1270 for publishable conditions. See Q1271 for declaration syntax. See Q1273 for the full gated types list.

Example

defines module qa.packagecapabilities.e12010fix

  defines package
    version <- 1.0.0-0
    description <- "Correctly declares all capabilities used — E12010 would have fired without these"
    license <- "MIT"
    publicAccess <- true
    capabilities <- ["org.ek9.lang::Stdout", "org.ek9.lang::Stderr"]

  defines function

    writeInfo()
      stdout <- Stdout()
      stdout.println("Info message on stdout")

    writeError()
      stderr <- Stderr()
      stderr.println("Error message on stderr")

Common mistakes

E12010 — The module uses both Stdout and Stderr. Declaring only Stdout leaves the Stderr usage uncovered — the compiler reports a separate E12010 for each undeclared gated type. Add 'org.ek9.lang::Stderr' to cover it. See ek9 -h E12010.

Incorrect:

    capabilities <- ["org.ek9.lang::Stdout"]

Correct:

    capabilities <- ["org.ek9.lang::Stdout", "org.ek9.lang::Stderr"]
Other ways to ask this
  • I'm getting E12010 UNDECLARED_CAPABILITY — what does this error mean?
  • The compiler says a type requires a capability declaration — how do I add it?
  • How do I fix 'type requires declared package capability' errors?
  • What triggers E12010 in EK9?

Coming from another language?

Java runtime SecurityException: similar in spirit but runtime-only, deprecated, and covers a narrower surface. .NET permissions: also runtime, similarly deprecated. Rust compile-time enforcement: limited to memory safety, not I/O capability. EK9 E12010: compile-time gated type check with immediate fix guidance from the rich error message and QA cross-references.

Keywords: error, fix, gated type, missing capability, UNDECLARED_CAPABILITY, E12010