{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/d1588981e0248aaa0174906c99df180e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"d1588981e0248aaa0174906c99df180e","url":"https://api.github.com/users/petdance","login":"petdance","id":41100},"assignee":null,"updated_at":"2011-11-14T06:01:10Z","labels":[{"name":"bug","color":"CEAEFF","url":"https://api.github.com/repos/petdance/scratch/labels/bug"},{"name":"core","color":"A37D9A","url":"https://api.github.com/repos/petdance/scratch/labels/core"},{"name":"Pri-normal","color":"64C2DA","url":"https://api.github.com/repos/petdance/scratch/labels/Pri-normal"},{"name":"Sev-medium","color":"8F0079","url":"https://api.github.com/repos/petdance/scratch/labels/Sev-medium"}],"closed_at":null,"comments":0,"url":"https://api.github.com/repos/petdance/scratch/issues/549","body":"When running this code isa returns true while it should return false\n$P1 = #object of type 'FOO::BAR::TEST'\r\n\r\n$P3 = get_hll_namespace [ 'FOO';'BAR2';'Object']\r\n\r\n$I1 = isa $P1,$P3\r\n\r\nreturns true must be false\r\n\r\n$P3 = string array with elements \"FOO\",\"BAR\",\"TEST\"\r\n\r\n$I1 = isa $P1,$P3\r\n\r\nreturns fasle must be true\r\n\r\nI solved this problem by replacing the    \r\n\r\n VTABLE INTVAL isa_pmc(PMC *lookup) \r\n\r\nfunction with the following code\r\n\r\n    VTABLE INTVAL isa_pmc(PMC *lookup) {\r\n\r\n       Hash   * const isa_hash = SELF->vtable->isa_hash;\r\n\r\n+      PMC    *classobj;\r\n\r\n       STRING *pmc_name;\r\n\r\n       if (PMC_IS_NULL(lookup))\r\n\r\n            return 0;\r\n            \r\n+      classobj = Parrot_oo_get_class(interp, lookup);\r\n\r\n+      if (PMC_IS_NULL(classobj))\r\n\r\n+         return 0;\r\n\r\n-+     pmc_name = VTABLE_get_string(interp, classobj);\r\n\r\n       if (!isa_hash)\r\n\r\n         return Parrot_str_equal(interp, SELF->vtable->whoami, pmc_name);\r\n\r\n       /* RT #46665 - walk mro */\r\n\r\n       return parrot_hash_exists(INTERP, isa_hash, (void*)pmc_name);\r\n\r\n    }\r\n\r\nI'am not sure it's completely correct, because i do not know how the mro isa_hash is build up.\r\n\r\nAdding this code will make 2 test failing in the t/tests/objects.t test set, because there are more bugs present, I made seperate ticket for that one\r\n\r\n\r\n\r\nOriginally http://trac.parrot.org/parrot/ticket/879","html_url":"https://github.com/petdance/scratch/issues/549","title":"isa does not take (correctly) namespace, pmcarray,stringarray","number":549,"id":2225907,"created_at":"2011-11-14T06:01:10Z"},"action":"opened"}