Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 30, 2025

Connection points lacked explicit typing, preventing type-safe integration across libraries and languages. This adds mandatory type annotations supporting basic types (string, integer, float, boolean) and custom types.

Syntax

element api_service:
    # Basic types (mandatory)
    connection_point port: integer = docker.exposed_port(dockerfile)
    connection_point api_url: string = config.get_url()
    connection_point ssl_enabled: boolean = config.get_flag('ssl')
    
    # Custom types (mandatory)
    connection_point handler: HttpHandler = python.public_functions(module)
    connection_point tokens: TokenStream = rust.struct_selector('Token')

All connection points must include a type annotation.

Implementation

  • AST: Added TypeAnnotation struct with mandatory type_annotation field on ConnectionPointDeclaration
  • Parser: Require mandatory : type syntax after connection point name
  • Grammar: Updated to connection_point identifier ':' identifier '=' expression
  • CLI: Display type annotations in output
  • Tests: 3 parser tests covering typed connection points and error handling for missing types

Documentation

  • Language reference updated with mandatory type annotation syntax, semantics, and examples
  • Self-description (hielements.hie) and all examples updated with typed connection points
  • New comprehensive example demonstrating type annotation features

Breaking Change

Type annotations are mandatory for all connection points. Provides type safety and clear documentation for cross-library validation.

Original prompt

connection points should have explicit typing to allow correct integration over multiple libraries / languages.

types can be basic types (string, integer, float, boolean) or custom types. custom types can be just aliases if basic types, or a composition (structure) of basic types.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits December 30, 2025 08:06
Co-authored-by: ercasta <1530425+ercasta@users.noreply.github.com>
Co-authored-by: ercasta <1530425+ercasta@users.noreply.github.com>
Copilot AI changed the title [WIP] Add explicit typing for connection points Add explicit type annotations to connection points Dec 30, 2025
Copilot AI requested a review from ercasta December 30, 2025 08:14
@ercasta
Copy link
Owner

ercasta commented Dec 30, 2025

Typing for connection points must be mandatory

Copy link
Owner

@ercasta ercasta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typing must be mandatory for connection points

Co-authored-by: ercasta <1530425+ercasta@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Dec 30, 2025

Typing for connection points must be mandatory

Type annotations are now mandatory for all connection points. Updated in commit 82ce308. All connection points must use the syntax connection_point name: type = expression.

Typing must be mandatory for connection points

Type annotations are now mandatory for all connection points. Updated in commit 82ce308. Parser requires the colon and type, and all examples have been updated.

Copilot AI changed the title Add explicit type annotations to connection points Add mandatory type annotations to connection points Dec 30, 2025
Copilot AI requested a review from ercasta December 30, 2025 08:40
@ercasta ercasta marked this pull request as ready for review December 30, 2025 08:53
@ercasta ercasta merged commit d868d5c into main Dec 30, 2025
5 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants