Rakudo: for any 1

Created on 27 Sep 2019  路  3Comments  路  Source: rakudo/rakudo

The Problem

Any for expression with no statement prefix and with a single junction argument produces a non-sensical result.

See https://stackoverflow.com/questions/58122017/can-gather-be-used-to-unroll-junctions

Expected Behavior

```
print .^name for any 1 ; # Junction

or, perhaps:

print .^name for any 1 ; # Int

## Actual Behavior

 ```
print .^name for any 1 ; # Mu

Environment

Rakudo 2018.12.

junctions regression

Most helpful comment

All 3 comments

Looking at roast I see:

Tests of for with junctional args at https://github.com/perl6/roast/blob/master/S03-junctions/autothreading.t#L274-L288 but they don't test the value passed into the block.

A test of for with a junctional arg at https://github.com/perl6/roast/blob/master/S03-junctions/misc.t#L209-L219 but the test is disabled with the comment "Not sure what is expected".

A test of for with a junctional arg at https://github.com/perl6/roast/blob/master/S03-junctions/misc.t#L361-L371 but the test doesn't test the value passed into the block.

Now outputs Junction, and is test-covered.

Was this page helpful?
0 / 5 - 0 ratings