Skip to content

fix: refuse argument labels and interface value types the compiler ignored, and dispatch tag-only enum methods - #1397

Merged
kacy merged 3 commits into
mainfrom
fix-silent-accepts
Nov 14, 2026
Merged

kacy merged 3 commits into
mainfrom
fix-silent-accepts

Conversation

@kacy

@kacy kacy commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Three shapes the compiler used to accept and then get wrong:

  • A labeled argument was parsed and then ignored, so f(b: 1, a: 5) bound by position and a label naming no parameter compiled. A label must now name the parameter in its position (E314), on functions, methods and generic functions. A call through a function value takes no labels, since the value has no parameter names.
  • A method in an impl on an enum without payloads passed the checker and then failed in the backend with "call to unknown function". Such an enum is an integer to the emitter, which lost the type name it dispatches on. The receiver now keeps the enum's name when its impl declares the method.
  • A parameter, return or field typed by an interface was accepted and then failed at its first use with "has no method". It is now refused at the annotation (E315) with a fix that points to a bounded type parameter, and the follow-on errors are muted.

docs/errors.md documents both new codes. Regression cases cover methods on a tag-only enum (with arguments, through a field and a list element, and through an interface impl), matching labels, and the two invalid shapes.

@kacy
kacy merged commit dfa783c into main Nov 14, 2026
4 checks passed
@kacy
kacy deleted the fix-silent-accepts branch November 14, 2026 21:42
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.

1 participant