E06260: invalid package property

Category: E06xxx Type hierarchy checks · Reported in phase: SYMBOL_DEFINITION · Classification: PACKAGE_PROPERTY_INVALID · All error codes

What went wrong

A property in your 'defines package' block has a value of the wrong shape, or is not a package property at all. This code is raised ONLY for package properties (the message starts "In '<module>' package:"), by the compiler, the language server and every tool alike. A package defines exactly these properties, each with one shape:

version                                   a VersionNumber literal (1.0.0-0)
description, license                      a String literal
publicAccess, applyStandardIncludes,
applyStandardExcludes                     a Boolean literal
tags, includeFiles, excludeFiles,
capabilities                              a List of String literals
deps, devDeps, excludeDeps                a Dict of (String, String) literals

Any other name is "unusable" - there is no 'name' property, because the module name IS the package name. A near miss names the property it is near ("unusable 'licence' property - did you mean 'license'?"); that is a hint, never a repair. It is NOT the wrong type passed to a method - that is E06270 / E50060 (the code was called PARAMETER_MISMATCH until it was renamed PACKAGE_PROPERTY_INVALID; the number is the same).

Worked examples

Compilable examples demonstrating this error and the correct fix:

How to fix it

  1. Give the property the shape it requires (the message names it)
  2. Remove a property name the package does not define; the module name is already the package name
  3. Package metadata drives versioning and publication, so it is checked before compilation - there is no conversion

The [EXAMPLE] section below shows each wrong shape, and an unknown 'name' property, with the block that gives every property its shape. 'deps' takes module names to version Strings: {"some.module": "1.0.0-0"}.

Common causes

  • version written as a String ("1.0.0") instead of a VersionNumber (1.0.0-0)
  • publicAccess written as "true" (String) instead of true
  • a single String given to a list property: tags <- "tools"
  • a 'name' property, as other build files have - the module declares it
  • A misspelt or made-up property name ('licence' for 'license')

See also

  • E06260: package property of the wrong shape, or unknown (this error)
  • E06261: a package with no 'description'
  • E06262: a package with no 'version'
  • E50050: a package property set twice
  • E50060: no method/function matches the argument types

Examples

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

Fails with E06260: invalid package property

#!ek9
defines module error.e06260.bad

  defines package

    version <- "1.0.0-0"

    description <- 12

    license <- 1.0.0-0

    publicAccess <- "yes"

    applyStandardIncludes <- "true"

    applyStandardExcludes <- 0

    tags <- "tools"

    deps <- {"a.b": 1.0.0-0}

    name <- "myLib"

Fixed: Give each package property a value of its own kind

#!ek9
defines module error.e06260.good

  defines package
    version <- 1.0.0-0
    description <- "A library"
    license <- "MIT"
    publicAccess <- true
    applyStandardIncludes <- true
    applyStandardExcludes <- false
    tags <- ["tools"]

Questions and answers

These Q&A entries show E06260 and its fix: