Index: tests/parameters.test =================================================================== diff -u -r76454eeb255e395a6a19345d558e0e96a9c47159 -r6a3cd1a111aa693839ec3d788262ce18be74bf91 --- tests/parameters.test (.../parameters.test) (revision 76454eeb255e395a6a19345d558e0e96a9c47159) +++ tests/parameters.test (.../parameters.test) (revision 6a3cd1a111aa693839ec3d788262ce18be74bf91) @@ -2349,3 +2349,37 @@ ? [list $o baz] "test" } + + +# +# Test incompatible forwarding to slot vs. noaccessor +# +nx::Test case forward-to-assign { + ? {nx::Class create Foo { + :property bar:noaccessor { + :public method assign { object property value } { + incr ::slotcalls 1 + nsf::var::set $object $property $value + } + }} + } "::Foo" + + # call without default, without object parameter value + ? {Foo new} "parameter bar: option 'noaccessor' cannot be used together with required accessor (assign method)" + + # test cases for default + nx::Class create Foo { + :property {baz:noaccessor 1} { + :public method assign { object property value } { + incr ::slotcalls 1 + nsf::var::set $object $property $value + } + } + } + + # call with default, without object parameter value + ? {Foo new} "parameter baz: option 'noaccessor' cannot be used together with required accessor (assign method)" + + # call with default, with object parameter value + ? {Foo new -baz "test"} "parameter baz: option 'noaccessor' cannot be used together with required accessor (assign method)" +}