File tree Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Expand file tree Collapse file tree 1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change @@ -1314,16 +1314,31 @@ class NQP::Actions is HLL::Actions {
1314
1314
# See if it's a lexical symbol (known in any outer scope).
1315
1315
my $ var ;
1316
1316
if $ * W . is_lexical(~ $ < name > ) {
1317
- try {
1318
- $ var := QAST ::WVal. new ( : value($ * W . find_sym([~ $ < name > ])) );
1319
- CATCH {
1320
- $ var := QAST ::Var. new ( : name(~ $ < name > ), : scope(' lexical' ) );
1317
+ unless $ < args > {
1318
+ try {
1319
+ my $ sym := $ * W . find_sym([~ $ < name > ]);
1320
+ unless nqp ::isnull(nqp ::getobjsc($ sym )) {
1321
+ $ var := QAST ::WVal. new ( : value($ sym ) );
1322
+ }
1321
1323
}
1322
1324
}
1325
+ unless $ var {
1326
+ $ var := QAST ::Var. new ( : name(~ $ < name > ), : scope(' lexical' ) );
1327
+ }
1323
1328
}
1324
1329
else {
1325
1330
my @ ns := nqp :: clone ($ < name >< identifier > );
1326
- $ var := lexical_package_lookup(@ ns , $/ );
1331
+ unless $ < args > {
1332
+ try {
1333
+ my $ sym := $ * W . find_sym(@ ns );
1334
+ unless nqp ::isnull(nqp ::getobjsc($ sym )) {
1335
+ $ var := QAST ::WVal. new ( : value($ sym ) );
1336
+ }
1337
+ }
1338
+ }
1339
+ unless $ var {
1340
+ $ var := lexical_package_lookup(@ ns , $/ );
1341
+ }
1327
1342
}
1328
1343
1329
1344
# If it's a call, add the arguments.
You can’t perform that action at this time.
0 commit comments