Class PackageProperties

java.lang.Object
org.ek9lang.compiler.support.PackageProperties
All Implemented Interfaces:
BiFunction<String, EK9Parser.AssignmentExpressionContext, Optional<String>>

public final class PackageProperties extends Object implements BiFunction<String, EK9Parser.AssignmentExpressionContext, Optional<String>>
THE rule for what a 'defines package' block may hold (E06260 PACKAGE_PROPERTY_INVALID): which property NAMES a package defines, and the SHAPE each one's value must have; which properties it MUST have ('version' E06262, 'description' E06261 - D16, Steve 2026-10-19); and that each is set once (E50050, in the package's own words).
  • A single literal of one kind: 'version' a Version, 'description' and 'license' a String, 'publicAccess' and the 'applyStandard...' flags a Boolean.
  • A List of String literals: 'tags', 'includeFiles', 'excludeFiles', 'capabilities'.
  • A Dict of (String, String) literals: 'deps', 'devDeps', 'excludeDeps'.

Any other name is unusable - there is no 'name' property, the module name IS the package name. A package property is metadata read before compilation, so being any primary is not enough - "yes" is a primary, and read as a Boolean it was silently false.

Shared by the CLI's package pre-pass (Ek9SourceVisitor) and the in-process pipeline (phase 1's PackagePropertyOrError), so the LSP, MCP tools and the CLI cannot disagree about what a package may hold - they report the same message at the same place. Use this - do not re-derive the property names or shapes.

This class is the shape rule (apply(String, EK9Parser.AssignmentExpressionContext)) and its NAMES; the block-level steps are PackagePropertyReportPoint (where a problem is reported), MissingPackageProperties and MissingPackagePropertyMessage (E06262, E06261), DuplicatePackageProperties and DuplicatePackagePropertyMessage (E50050) - no-statics lane S3, 2026-10-29: were reportAt, missing, missingMessage, duplicates and duplicateMessage here; names() is the NAMES constant; isKnown, requiredLiteralType and isOfRequiredKind had no caller outside this class and are gone.