Ticket #538 (closed bug: invalid)
NQP list initializers
| Reported by: | bsdz | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | nqp | Version: | trunk |
| Severity: | medium | Keywords: | |
| Cc: | pmichaud | Language: | |
| Patch status: | Platform: | all |
Description
When a list is declared in NQP with only one element a scalar is created.
i.e, the following nqp script: -
load_bytecode('library/dumper.pbc');
my @my_list := (10);
_dumper(@my_list, 'my_list');
displays: -
"my_list" => 10
when it should show: -
"my_list" => ResizablePMCArray (size:1) [
10
]
A workaround is to place a dummy element and shift it. i.e.
my @my_list := ('dummy', 10);
@my_list.shift();
_dumper(@my_list, 'my_list');
Change History
Note: See
TracTickets for help on using
tickets.
