Why does EK9 report E06260 when defining package properties?

← Classes and OOP · Ref: Q955

Package properties in EK9 have strict type requirements. The 'version' property must be a VersionNumber literal, 'description' and 'license' must be Strings, and 'publicAccess' must be Boolean. Using the wrong type triggers E06260.

PACKAGE PROPERTY TYPES

  version <- 1.0.0-0           // VersionNumber literal
  description <- "My package"  // String literal
  license <- "MIT"             // String literal
  publicAccess <- true          // Boolean literal

WHY ENFORCED

Package metadata is used by the build system and dependency management. Invalid types would break version resolution, licensing, and publication. The compiler validates each property type at parse time.

See Q10 for module structure. See Q852 for reserved module names. See Q14 for package organization.

Example

defines module qa.classes.paramtypemismatch

  defines package

    version <- 1.0.0-0
    description <- "Demonstrates correct package property types"

  defines program

    PackagePropertyDemo()
      stdout <- Stdout()
      stdout.println("Package properties use strict types")
      stdout.println("version: VersionNumber, description: String")
Other ways to ask this
  • What triggers E06260 PARAMETER_MISMATCH in packages?
  • Why must package version be a VersionNumber type?
  • How do I correctly declare package properties?

Coming from another language?

Java: pom.xml version is a free-form string. Python: setup.py version is a string. Rust: Cargo.toml version uses semver strings. Go: go.mod uses semver tags. EK9: version is a typed VersionNumber literal validated at compile time, E06260 if wrong type.

Keywords: property, VersionNumber, parameter, version, metadata, package, mismatch, build, E06260, type