Menu

#174 ::REQUIRES circularity nonobvious failure

open
nobody
None
5
2012-08-14
2010-12-22
No

Environment: Win 7

See bug 3141401, note this report has updated code attached. The circular ::REQUIRES references diagnosed as illegal in 3141401 cause a nonobvious runtime failure. I ran into it while refactoring some code and spent a fine old time finding out what I'd done wrong.

Note that init code in both packages has run without error and at the point of failure .context~package~importedpackages appears to know everything about the class1 class which can't be instantiated.

Some indication at runtime that a circular reference can't be resolved (rather than an uninitialised variable not understanding message "new") would be ideal, but at least mentioning the illegality of the situation with an illustration of the problem in the reference under 3.6 ::REQUIRES might help a lot.

Output of new improved test program:

C:\Users\gs\exlibris\rexx\requirestest>rtest
class2 init
class1 init
REXX-ooRexx_4.1.0(MT) 6.03 5 Dec 2010
class1 test The CLASS2 class
imported package C:\Users\gs\exlibris\rexx\requirestest\class2.cls contains
class The CLASS2 class contains
method COPY
method RUN
method START
method STARTWITH
method IDENTITYHASH
method SETMETHOD
method HASHCODE
method INSTANCEMETHODS
method UNSETMETHOD
method <>
method TESTME
method \=
method OBJECTNAME
method SEND
method INSTANCEMETHOD
method ISA
method ISINSTANCEOF
method ||
method
method INIT
method OBJECTNAME=
method STRING
method DEFAULTNAME
method HASMETHOD
method SENDWITH
method ><
method REQUEST
method
method ==
method CLASS
method =
method \==
contains init? 1
class2 test .CLASS1
imported package C:\Users\gs\exlibris\rexx\requirestest\class1.cls contains
class The CLASS1 class contains
method COPY
method RUN
method START
method STARTWITH
method IDENTITYHASH
method SETMETHOD
method HASHCODE
method INSTANCEMETHODS
method UNSETMETHOD
method <>
method TESTME
method \=
method OBJECTNAME
method SEND
method INSTANCEMETHOD
method ISA
method ISINSTANCEOF
method ||
method
method INIT
method OBJECTNAME=
method STRING
method DEFAULTNAME
method HASMETHOD
method SENDWITH
method ><
method REQUEST
method
method ==
method CLASS
method =
method \==
contains init? 1
23 - c1 = .class1~new
7 - tc2~testme
Error 97 running C:\Users\gs\exlibris\rexx\requirestest\class2.cls line 23: Object method not found
Error 97.1: Object ".CLASS1" does not understand message "NEW"

Discussion

  • Geoff Stevens

    Geoff Stevens - 2010-12-22

    test main

     
  • Geoff Stevens

    Geoff Stevens - 2010-12-22

    package 1

     
  • Geoff Stevens

    Geoff Stevens - 2010-12-22

    package 2

     
  • Mark Miesfeld

    Mark Miesfeld - 2012-02-06

    Moving this to the documentation tracker.

     

Anonymous
Anonymous

Add attachments
Cancel