Skip to content

checker: fix wrapped fn aliases in multiple returns - #27977

Merged
medvednikov merged 1 commit into
masterfrom
agent/fix-interface-fn-alias-return
Jul 30, 2026
Merged

checker: fix wrapped fn aliases in multiple returns#27977
medvednikov merged 1 commit into
masterfrom
agent/fix-interface-fn-alias-return

Conversation

@medvednikov

Copy link
Copy Markdown
Member

Fixes #27976.

What changed

  • compare interface method multiple-return signatures component by component
  • reuse the existing strict wrapped function-alias compatibility rules for each component
  • add a regression test for an optional function alias inside a multiple return

Root cause

The checker only applied wrapped function-alias compatibility when the complete method return type was a function. A MultiReturn symbol stopped that comparison before it reached the optional function component, so identical signatures were rejected.

Impact

Concrete methods whose multiple-return signatures exactly match an interface now satisfy that interface when a component is an optional function type alias. Existing incompatible wrapped-alias cases remain rejected.

Checks

  • VFLAGS='-gc none' ./vnew -gc none -silent vlib/v/compiler_errors_test.v (1604 passed, 1 skipped)
  • VFLAGS='-old-compiler -gc none' ./vnew -old-compiler -gc none -silent test vlib/v/tests/interfaces/ (101 passed)
  • VFLAGS='-old-compiler -gc none' ./vnew -old-compiler -gc none -silent test vlib/v/ast/ (5 passed)
  • VFLAGS='-old-compiler -gc none' ./vnew -old-compiler -gc none -silent test vlib/v/checker/ (3 passed)

A full vlib/v/ run was also started, but the isolated worktree does not contain the ignored bundled thirdparty/tcc GC runtime, so GC-specific tests failed on missing libgc.dylib before the run completed.

@medvednikov

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: a7e0ccb172

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@medvednikov
medvednikov marked this pull request as ready for review July 30, 2026 04:13
@medvednikov
medvednikov merged commit f20fe19 into master Jul 30, 2026
49 of 95 checks passed
@JalonSolov
JalonSolov deleted the agent/fix-interface-fn-alias-return branch July 30, 2026 11:58
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.

checker: Interface incorrectly implements method error when using function type alias in multiple return values

1 participant