Skip to content

checker: fix multi return var passing to fn arg#25250

Merged
spytheman merged 1 commit into
vlang:masterfrom
felipensp:multi_return_validation_arg
Sep 8, 2025
Merged

checker: fix multi return var passing to fn arg#25250
spytheman merged 1 commit into
vlang:masterfrom
felipensp:multi_return_validation_arg

Conversation

@felipensp

Copy link
Copy Markdown
Member

Fix #24870

@huly-for-github

Copy link
Copy Markdown

Connected to Huly®: V_0.6-24879

@felipensp felipensp marked this pull request as ready for review September 6, 2025 14:51

@spytheman spytheman left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Excellent work.

@spytheman

Copy link
Copy Markdown
Contributor

I did not see the connection with the issue 🤔 , which seemed to report something related to the Context params in veb.

@spytheman spytheman merged commit 19ca0d0 into vlang:master Sep 8, 2025
83 of 84 checks passed
@spytheman

Copy link
Copy Markdown
Contributor

No, it does not solve the issue (which was a bit hard to replicate):

#0 09:39:35 ^ master ~/v>git pull
remote: Enumerating objects: 9, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 9 (delta 3), reused 3 (delta 3), pack-reused 3 (from 1)
Receiving objects: 100% (9/9), 93.36 KiB | 985.00 KiB/s, done.
Resolving deltas: 100% (3/3), completed with 3 local objects.
From github.com:vlang/v
   84f68168ed..19ca0d0346  master     -> origin/master
Updating 84f68168ed..19ca0d0346
Fast-forward
#0 09:39:39 ^ master ~/v>./v self
V self compiling ...
V built successfully as executable "v".
#0 09:39:44 ^ master ~/v>v .
xxx.v:7:7: error: assignment mismatch: 1 variable but `a()` returns 2 values
    5 | }
    6 | fn main() {
    7 |     rets := a()
      |          ~~
    8 |     b(1, rets)
    9 | }
xxx.v:8:2: error: expected 2 arguments, but got 3
    6 | fn main() {
    7 |     rets := a()
    8 |     b(1, rets)
      |     ~~~~~~~~~~
    9 | }
Details: have (int literal, (int, int))
         want (int, []int)
#1 09:39:47 ^ master ~/v>cd -
/home/delian/v/peony
#0 09:39:50 ^ (HEAD detached at 21d031d) ~/v/peony>v .
================== C compilation error (from tcc): ==============
cc: /tmp/v_1000/peony.01K4M0TTYK4FCD7CGW2AHF5EZC.tmp.c:50969: warning: assignment from incompatible pointer type
cc: /tmp/v_1000/peony.01K4M0TTYK4FCD7CGW2AHF5EZC.tmp.c:57988: error: cannot convert 'struct string' to 'struct main__RetrieveProductParams'
...
cc: /tmp/v_1000/peony.01K4M0TTYK4FCD7CGW2AHF5EZC.tmp.c:57988: error: cannot convert 'struct string' to 'struct main__RetrieveProductParams'
(note: the original output was 10 lines long; it was truncated to its first 2 lines + the last line)
=================================================================
(You can pass `-cg`, or `-show-c-output` as well, to print all the C error messages).
#1 09:39:55 ^ (HEAD detached at 21d031d) ~/v/peony>

@spytheman

Copy link
Copy Markdown
Contributor

the PR does solve an unrelated problem though, so perhaps it was just for another issue, not #24870 .

@spytheman spytheman mentioned this pull request Sep 8, 2025
@felipensp felipensp deleted the multi_return_validation_arg branch September 8, 2025 10:35
@felipensp

Copy link
Copy Markdown
Member Author

the PR does solve an unrelated problem though, so perhaps it was just for another issue, not #24870 .

Interesting, for me it was

image

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 error

2 participants