Index: tests/parameters.test =================================================================== diff -u -r5d1617640ad71fd52b069f81cfcadbe4cbb6f2a2 -r4c9e3b2b545a49698aa2284cc8dc5d5bb2719703 --- tests/parameters.test (.../parameters.test) (revision 5d1617640ad71fd52b069f81cfcadbe4cbb6f2a2) +++ tests/parameters.test (.../parameters.test) (revision 4c9e3b2b545a49698aa2284cc8dc5d5bb2719703) @@ -1831,19 +1831,73 @@ } # -# Test incfluence of mixins on objectparameters +# Test interactions between per-object-mixins and objectparameters +# (case without per-object property) # nx::Test case parameter-object-mixin-dependency { nx::Class create C { :property a1 + :create c1 + } + nx::Class create D -superclass C + nx::Class create M {:property b1:required} + + ? {c1 eval :__objectparameter} "-a1 -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" + + c1 mixin M + + ? {c1 info precedence} "::M ::C ::nx::Object" + + ? {c1 eval :__objectparameter} "-b1:required -a1 -volatile:alias,noarg -properties:alias,method=::nx::internal::addProperties -noinit:alias,method=::nsf::methods::object::noinit,noarg -mixin:mixinreg,alias,0..n -class:class,alias,method=::nsf::methods::object::class -filter:filterreg,alias,0..n __initcmd:initcmd,optional,noleadingdash" + + # + # Invalidate the object parameter and expect that the per-class + # mixin does not harm + # + ::nsf::invalidateobjectparameter C + + # + # We have now "-b1:required" in the object parameters. + # + # TODO: Actually we should enforce it. We could check, if the + # associate variable is already set, but this does not work for + # aliases.... we could track, if the slot is already initialized for + # this object. This can be a potentially huge table containing + # potentially all objects (relation slots). Maybe keep the table + # just for "required" parameters? or look for an approach based on + # epoch counting? + # + ? {c1 configure -a1 x} "" + + # + # The object parameter based on the per-object-mixin must not be + # stored in the class based cache. Therefore, creating a new object + # must not require b1 + + ? {C create c2} ::c2 + + # + # the same should hold for subcles + # + ? {D create d1} ::d1 + + +} + + +# +# Test interactions between per-object-mixins and objectparameters +# (case with per-object property) +# +nx::Test case parameter-object-mixin-dependency-object-property { + nx::Class create C { + :property a1 :create c1 { :property a2 } } - - nx::Class create M { - :property b1:required - } + nx::Class create D -superclass C + nx::Class create M {:property b1:required} c1 mixin M @@ -1869,10 +1923,11 @@ # should not require b1 ? {C create c2} ::c2 - + } + # # Test integer, wideinteger and bignums #