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

Confusing error message from oo.tcl #248

Closed
prpr19xx opened this issue Jan 3, 2023 · 0 comments
Closed

Confusing error message from oo.tcl #248

prpr19xx opened this issue Jan 3, 2023 · 0 comments

Comments

@prpr19xx
Copy link
Contributor

prpr19xx commented Jan 3, 2023

With the following:

package require oo

class t {
        v1 0
        v2 0
}

set v [t new {v1 1 v3 2}]

it generates an unhelpful/confusing error message:

oo.tcl:85: Error: can't read "classname": no such variable
in procedure 't new' 
in procedure '::<reference.<t______>.00000000000000000004>' called at file "oo.tcl", line 51
in procedure 't defaultconstructor' called at file "oo.tcl", line 49
at file "oo.tcl", line 68
at file "oo.tcl", line 85
[error] .

talking about "classname" when actually it's a variable name that is the problem (a typo of 'v3' instead of 'v2').
If you do this, you get a more sane response:

. puts [$v get v3]
oo.tcl:92: Error: can't read "v3": no such variable
in procedure '::<reference.<t______>.00000000000000000006>' 
in procedure 't get' called at file "oo.tcl", line 49
at file "oo.tcl", line 68
at file "oo.tcl", line 92
[error] . 
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

No branches or pull requests

1 participant