Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Error Message for assignment value mismatch is too vague

Open LillyProgrammingIncorprated opened this issue 3 years ago • 2 comments

Context

  • Operating System & Odin Version: git pulled 10 minutes ago (9th of March 2022, 12:13 PST)

Expected Behavior

A clearer message to explain what is actually going wrong ex: "Expected 2 assignment variables from function. Found 1"

Current Behavior

Vague message talking about mismatch of seemingly nothing (to beginners) Assignment count mismatch '1' = '2'

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. call a function that returns multiple values
  2. assign it to only 1 variable
  3. get the vague message

example code:

package main

foo :: proc () -> (u8, u8) {
        return 'a', 'b'
}

main :: proc () {

        x := foo()
}

Failure Logs

something that specifies that it is a mismatch of return count is needed

something like "Expected 2 assignment variables from foo. Found 1"

Hello!

I am marking this issue as stale as it has not received any engagement from the community or maintainers 120 days. That does not imply that the issue has no merit! If you feel strongly about this issue

  • open a PR referencing and resolving the issue;
  • leave a comment on it and discuss ideas how you could contribute towards resolving it;
  • leave a comment and describe in detail why this issue is critical for your use case;
  • open a new issue with updated details and a plan on resolving the issue.

The motivation for this automation is to help prioritize issues in the backlog and not ignore, reject, or belittle anyone..

github-actions[bot] avatar Jul 24 '22 22:07 github-actions[bot]