Index: TODO =================================================================== diff -u -r7257200f41c3bd0d0309db6932e5788d860fa119 -rfe643dd6330cf3deb036335f20ce4113a2e2aee3 --- TODO (.../TODO) (revision 7257200f41c3bd0d0309db6932e5788d860fa119) +++ TODO (.../TODO) (revision fe643dd6330cf3deb036335f20ce4113a2e2aee3) @@ -3059,10 +3059,12 @@ - extended regression test - added support for "class variable" - added tests for "variable" + multiplicity and "class variable" +- provide error message, when method variable is a noop + (e.g. no value provided and no accessor is wanted) + TODO: - - provide warning, when method variable is a noop - (e.g. no value provided and no accessor is wanted) + - variable and incremental, test for user-defined types - should we change interface for default value in attribute? probably not, same interface is used in methodparameters as well - Should we leave "variable" and "attribute" as it ist? Index: library/nx/nx.tcl =================================================================== diff -u -r7257200f41c3bd0d0309db6932e5788d860fa119 -rfe643dd6330cf3deb036335f20ce4113a2e2aee3 --- library/nx/nx.tcl (.../nx.tcl) (revision 7257200f41c3bd0d0309db6932e5788d860fa119) +++ library/nx/nx.tcl (.../nx.tcl) (revision fe643dd6330cf3deb036335f20ce4113a2e2aee3) @@ -1646,6 +1646,8 @@ set name $spec } set :$name $value + } else { + error "Variable definition for '$name' (without default and accessor) is useless" } return } Index: tests/parameters.test =================================================================== diff -u -r7257200f41c3bd0d0309db6932e5788d860fa119 -rfe643dd6330cf3deb036335f20ce4113a2e2aee3 --- tests/parameters.test (.../parameters.test) (revision 7257200f41c3bd0d0309db6932e5788d860fa119) +++ tests/parameters.test (.../parameters.test) (revision fe643dd6330cf3deb036335f20ce4113a2e2aee3) @@ -1861,8 +1861,10 @@ ? [list [self] attribute -nocomplain [list xm2:int,1..n {1 2a 3}]] \ {invalid value in "1 2a 3": expected integer but got "2a"} - # more tests, e.g. multiplicity and user-defined type - # incremental, + # useless definition + ? [list [self] variable dummy:int] {Variable definition for 'dummy' (without default and accessor) is useless} + + # more tests, e.g. user-defined type and incremental } nx::Class create C {