.
D 2009-01-23T09:36:23
J assignee dkf
J cmimetype text/plain
J comment \nI\sfound\sthe\sbehaviour\sexhibited\sin\sthe\swish\ssession\sbelow\ssurprising.\sDefining\san\sempty\sconstructor\sbehaves\sas\sthough\sno\sconstructor\swas\sdefined\sfor\sthe\sclass\sat\sall.\sIn\sparticular,\n-\sI\swould\sexpect\sthe\sderived\sclass\sconstructor\sto\s"hide"\sthe\ssuperclass\sconstructor\sand\snot\sexecute\sit\ssince\sthere\sis\sno\snext\scall.\sCreating\sa\sD\sobject\sis\sseen\sto\srun\sthe\sC\sconstrutor\n-\sI\swould\sexpect\sinfo\sclass\sconstructor\sD\sto\sreturn\sa\spair\scontaining\sthe\sarg\sa\sand\san\sempty\sbody\n-\sA\sconstructor\sdefined\swith\san\sempty\sbody\sbehaves\sthe\ssame\sas\sa\sconstructor\sdefined\swith\sthe\sstatement\s"next"\s(or\ssimilar,\sthere\smight\sbe\sdifferences\sin\spresence\smixins).\sThat\sdoes\snot\sseem\sright\n-\sAdding\sa\scomment\sto\sa\sbody\schanges\sthe\scode\sthat\sis\sexecuted\s-\ssee\sthe\sdifference\sbetween\sbehaviour\sof\sclass\sD\sand\sE,\sthe\sonly\sdifference\sbeing\saddition\sof\sa\scomment.\sThis\sto\sme\sis\sthe\sbiggest\sNO-NO.\n\n(web)\s2\s%\soo::class\screate\sC\s{\n>\sconstructor\s{a}\s{set\s::x\s$a}\n>\s}\n::C\n(web)\s3\s%\soo::class\screate\sD\s{\n>\ssuperclass\sC\n>\sconstructor\s{a}\s{}\n>\s}\n::D\n(web)\s4\s%\sinfo\sclass\sconstructor\sD\n(web)\s5\s%\sinfo\sclass\sconstructor\sC\na\s{set\s::x\s$a}\n(web)\s6\s%\sD\screate\sd\nwrong\s#\sargs:\sshould\sbe\s"D\screate\sd\sa"\n(web)\s7\s%\sD\screate\sd\s1\n::d\n(web)\s8\s%\sset\sx\n1\n(web)\s10\s%\soo::class\screate\sE\s{\n>\ssuperclass\sC\n>\sconstructor\s{a}\s{\s#\sJust\sa\scomment\s}\n>\s}\n::E\n(web)\s11\s%\sset\sx\s0\n0\n(web)\s12\s%\sE\screate\se\nwrong\s#\sargs:\sshould\sbe\s"E\screate\se\sa"\n(web)\s13\s%\sE\screate\se\sabc\n::e\n(web)\s14\s%\sset\sx\n0\n\n/Ashok
J foundin obsolete:\s8.6b1
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter apnadkarni
J subsystem 35.\sTclOO\sPackage
J title Surprising\sbehaviour\sof\sempty\sconstructor
J type Bug
K 2530725fffffffffffffffffffffffffffffffff
U apnadkarni
Z 388ddfb70d7ca992a78187bde113631c