#1492: Get_class <namespace> confuses NSes that have same final name.
-----------------------------+----------------------------------------------
Reporter: Austin_Hastings | Owner: whiteknight
Type: bug | Status: new
Priority: normal | Milestone:
Component: core | Version: 2.1.0
Severity: high | Keywords: namespace, class, get_class
Lang: | Patch:
Platform: |
-----------------------------+----------------------------------------------
Changes (by whiteknight):
* owner: => whiteknight
Comment:
Okay, here are some preliminary digging results. This code prints what we
expect:
{{{
.sub foo :main
.local pmc class_p
.local pmc class_nsp
class_p = newclass [ 'P' ]
class_nsp = newclass ["N";'S';'P']
say class_p
say class_nsp
$P0 = new ['P']
$P0.'bar'()
$P1 = new ['N';'S';'P']
$P1.'bar'()
.end
.namespace ['N';'S';'P']
.sub bar :method
say "NSP"
.end
.namespace ['P']
.sub bar :method
say "P"
.end
}}}
This correctly says:
{{{
P
N;S;P
P
NSP
}}}
However, when we look up using the namespace, we have a problem:
{{{
.sub foo :main
.local pmc class_p
.local pmc class_nsp
class_p = newclass [ 'P' ]
$P1 = get_hll_namespace ['N';'S';'P']
class_nsp = get_class $P1
say class_p
say class_nsp
$P0 = new ['P']
$P0.'bar'()
$P1 = new ['N';'S';'P']
$P1.'bar'()
.end
.namespace ['N';'S';'P']
.sub bar :method
say "NSP"
.end
.namespace ['P']
.sub bar :method
say "P"
.end
}}}
Which outputs something like this (I've ommitted line numbers since they
are different in my test file:
{{{
P
P
P
Class '[ 'N' ; 'S' ; 'P' ]' not found
}}}
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/1492#comment:1>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets