snit methods with same name confuses tclchecker

Posted by none on 2014-08-27 08:39
Forums: TDK discussion | OS: All / Any

It appears that tclchecker gets confused if the same method name is used in multiple types. For instance, with this code:

package require snit

snit::type Foo {
    method same_name { foo_arg } {
        set bar_arg $foo_arg
    }
}

snit::type Bar {
    method same_name { bar_arg } {
        set foo_arg $bar_arg
    }
}

It complains:

foo.tcl:5 (warnArgWrite) Overwriting procedure argument "bar_arg"
set bar_arg $foo_arg
^
foo.tcl:11 (warnArgWrite) Overwriting procedure argument "foo_arg"
set foo_arg $bar_arg
^

It appears to be confused about which argument is used with each method. I can get rid of the warnings with #checker commands, but it seems like there is potential for some errors being missed because of this as well.

Thanks,
-paul