E01088: only one 'defines package' block is permitted per module

Category: E01xxx Parsing and excluded constructs · Reported in phase: SYMBOL_DEFINITION · Classification: DUPLICATE_PACKAGE_BLOCK · All error codes

What went wrong

A second 'defines package' block has been declared in this module. EK9 permits only one 'defines package' block per module, regardless of whether it appears in the same file or across multiple files in the same module.

Worked examples

Compilable examples demonstrating this error and the correct fix:

  • ek9 -h packaging (Package declaration syntax and metadata fields)

Common causes

  • Copy-paste of a package block without removing the original
  • Merging files from different modules into the same module
  • Multiple developers adding package metadata in different files of the same module

How to fix it

Remove the duplicate 'defines package' block. Consolidate all package metadata into a single 'defines package' block, either in one file or by choosing which file should contain the package definition.

The [EXAMPLE] section below shows the duplicate block and the single block that replaces it.

See also

Examples

Every example is compiled by the EK9 compiler: the first fails exactly as captioned, the others fix it.

Fails with E01088: only one 'defines package' block is permitted per module

#!ek9
defines module error.e01088.bad

  defines package
    description <- "A library"
    version <- 1.0.0-0

  defines package
    description <- "A library"
    version <- 2.0.0-0

Fixed: One defines package block per module, holding every package property

#!ek9
defines module error.e01088.good

  defines package
    description <- "A library"
    version <- 2.0.0-0