Skip to content

fix: allow mixing of implicit and explicit arguments#1698

Open
mhasel wants to merge 6 commits intomasterfrom
mihr/mix-implicit-explicit-args
Open

fix: allow mixing of implicit and explicit arguments#1698
mhasel wants to merge 6 commits intomasterfrom
mihr/mix-implicit-explicit-args

Conversation

@mhasel
Copy link
Copy Markdown
Member

@mhasel mhasel commented Apr 23, 2026

No description provided.

@mhasel mhasel marked this pull request as ready for review April 23, 2026 17:06
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

Build Artifacts

🐧 Linux

Artifact Link Size
deb-x86_64 Download 38.4 MB
schema Download 0.0 MB
stdlib Download 32.4 MB
plc-x86_64 Download 43.6 MB
deb-aarch64 Download 30.9 MB
plc-aarch64 Download 43.5 MB

From workflow run

🪟 Windows

Artifact Link Size
stdlib.lib Download 4.3 MB
stdlib.dll Download 0.1 MB
plc.exe Download 38.4 MB

From workflow run

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Heads up, I reused E117 in #1683

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Idle thought, we can make our life much easier if the call lowerer would solve this:

  • Re-order the paramters,
  • Make everything either formal or not
  • Fill in missing parameters with the default value
    But we need to make sure we still hit the validation.

not saying you should do it now, just thought it might make it easier

PROGRAM main
VAR x : INT; END_VAR
// `1` sits in position 0 (param `a`), but `a := 10` also targets `a`.
// The resolver silently reinterprets the call as `a := 10, b := 1`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd remove this line, you're leaking internal architecture to the user. A user probably doesn't know what a resolver is nor do they care.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fair point

@mhasel mhasel requested a review from volsa April 24, 2026 10:40
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.

3 participants