E07600: program arguments are limited to a finite range of EK9 built in types

Category: E07xxx Full resolution · Reported in phase: EXPLICIT_TYPE_SYMBOL_DEFINITION · Classification: PROGRAM_ARGUMENT_TYPE_INVALID · All error codes

What went wrong

A program argument uses a type that isn't supported for command-line arguments.

Worked examples

Compilable examples demonstrating this error and the correct fix:

  • ek9 -q 947 (Which types are allowed for typed program arguments in...)

Supported program argument types

  • String, Integer, Float, Boolean
  • Date, Time, DateTime
  • List of above types

How to fix it

  1. Use supported built-in types for program arguments
  2. Parse custom types from String inside program

The [EXAMPLE] section below shows a record as a program argument, and the program taking built-in types and building the record from them.

Common causes

  • Custom type as program argument
  • Complex type without command-line representation

See also

  • E07600: unsupported program argument type (this error)
  • E07610: incompatible argument combination

Examples

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

Fails with E07600: program arguments are limited to a finite range of EK9 built in types

#!ek9
defines module error.e07600.bad

  defines record

    Person
      name <- String()
      age <- Integer()

      default operator ?

  defines program

    //The command line holds text, which EK9 converts to its built-in types only
    Register()
      -> person as Person
      stdout <- Stdout()
      stdout.println("registered")

Fixed: Take built-in types and build the record

#!ek9
defines module error.e07600.good

  defines record

    Person
      name <- String()
      age <- Integer()

      Person()
        ->
          personName as String
          personAge as Integer

        this.name :=: personName
        this.age :=: personAge

      default operator ?

  defines program

    //Take built-in types, and build the record from them
    Register()
      ->
        name as String
        age as Integer

      stdout <- Stdout()
      person <- Person(name, age)
      stdout.println(`registered: ${person.name}`)

Questions and answers

These Q&A entries show E07600 and its fix: