Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argument counts are broken? #15

Closed
skx opened this issue Jun 22, 2022 · 0 comments · Fixed by #17
Closed

Argument counts are broken? #15

skx opened this issue Jun 22, 2022 · 0 comments · Fixed by #17
Assignees

Comments

@skx
Copy link
Owner

skx commented Jun 22, 2022

The following code runs:

proc foo {} {
   if { 1 } {
      return "steve"
   } else {
       return "bar"
   }
    puts "I'm still here ..?"
}

foo 1

Obviously foo should take zero arguments, but calling like that fails:

$ ./critical a.tcl
Error running program:function argument mismatch, foo takes 1 arguments, 0 supplied

This is the first of two issues with that same piece of code. See also #16.

skx added a commit that referenced this issue Jun 22, 2022
We'd previously count the number of required arguments incorrectly
for user-defined procedures.  This was caused by trying to split
arguments by spaces - if no spaces were present we'd return one
regardless.

This update fixes that, and closes #15.
@skx skx self-assigned this Jun 22, 2022
@skx skx closed this as completed in #17 Jun 22, 2022
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 a pull request may close this issue.

1 participant