Ticket #1518 (closed bug: invalid)

Opened 12 years ago

Last modified 10 years ago

NQP-rx generates wrong twigil for contextual lookups

Reported by: Austin_Hastings Owned by: pmichaud
Priority: normal Milestone:
Component: nqp Version: 2.2.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:


Trying to use $*..., I get two behaviors depending on the presence or absence of a namespace. I suspect that the '*' isn't being carried from the front of the namespace to the identifier name in the more-complex case:

.sub "_block11"  :anon :subid("10_1268905264.09348")
.annotate "line", 1
    find_dynamic_lex $P13, "$Filesystem"
    unless_null $P13, vivify_11
    get_hll_global $P13, "$Kakapo::Filesystem"
    unless_null $P13, vivify_12
    die "Contextual $*Kakapo::Filesystem not found"
    store_dynamic_lex "$Filesystem", $P13
.annotate "line", 2
    find_dynamic_lex $P14, "$*Filesystem"
    unless_null $P14, vivify_13
    get_hll_global $P14, "$Filesystem"
    unless_null $P14, vivify_14
    die "Contextual $*Filesystem not found"
.annotate "line", 1
    .return ($P14)

Change History

Changed 10 years ago by pmichaud

  • status changed from new to closed
  • resolution set to invalid

Contextuals (now "dynamic variables") are always lexically scoped and not associated with a namespace. Something like $*Kakapo::Filesystem should probably throw an exception of some sort.

If it's still important to fix, file an nqp-rx issue. Thanks!


Note: See TracTickets for help on using tickets.