Why does my EK9 code fail with E11031 when I use 'data' as a variable name?

← Variable Naming Rules and Conventions · Ref: Q922

E11031 means you used a banned non-descriptive variable name. The name 'data' tells the reader nothing about what it represents. EK9 enforces naming quality at compile time — this is not a warning, it is an error.

EK9 banned names are NOT Java reserved keywords. They are generic identifiers rejected for quality reasons.

EK9 bans exactly 12 non-descriptive names (E11031): temp, tmp, flag, flg, data, dat, object, obj, value, val, buffer, buf. These are case-insensitive. Names like str, num, item, result, input, output, count, index, list, map, set, key, status, state, type, config, param, arg, var, ret, res are NOT banned.

Separately, E11032 bans operator keywords as variable names: empty, length, contains, abs, sqrt, close, matches.

FIX: Replace with a descriptive name. Instead of 'data', use 'payload', 'sensorReading', 'configEntry'.

ALWAYS ALLOWED EXCEPTIONS:

- Single-character names: x, y, z, i, j, k (math variables, loop counters)
- Compound words: dataProcessor, inputStream, configPath
- Descriptive alternatives: payload, threshold, customerRecord

Example

defines module qa.naming.whycompileerror

  defines function

    <?-
      Shows how to fix E11031 by using descriptive names.
    -?>
    fetchPayload() as pure
      <- payload as String: "sensor-data-packet"

  defines program

    WhyCompileErrorDemo()
      stdout <- Stdout()

      // WRONG: data <- fetchPayload()   triggers E11031
      // FIXED: descriptive name
      payload <- fetchPayload()
      stdout.println(`Payload: ${payload}`)

      // WRONG: temp <- 42.5   triggers E11031
      // FIXED: descriptive name
      sensorReading <- 42.5
      stdout.println(`Sensor: ${sensorReading}`)

      // Compound words: ALLOWED (dataProcessor contains 'data' but is compound)
      dataProcessor <- "jsonParser"
      stdout.println(`Processor: ${dataProcessor}`)

      // Single-char loop counters: ALLOWED
      i <- 1
      k <- 10
      stdout.println(`Range: ${i} to ${k}`)

Common mistakes

E11031 — The name 'data' is banned (E11031). Replace with a descriptive name like 'payload' that tells the reader what this variable holds.

Incorrect:

      data <- fetchPayload()
      stdout.println(`Payload: ${data}`)

Correct:

      payload <- fetchPayload()
      stdout.println(`Payload: ${payload}`)
Other ways to ask this
  • What does E11031 mean?
  • Why is 'data' rejected by the EK9 compiler?
  • How do I fix E11031 naming error?

Keywords: error, compile, data, E11031, naming, fix, banned