[perl #129142] [BUG] Parse error when coercing an enum from a coercion of an enum from an int

2018-04-07 Thread Jan-Olof Hendig via RT
On Fri, 16 Mar 2018 16:02:15 -0700, jan-olof.hen...@bredband.net wrote:
> On Tue, 30 Aug 2016 16:30:24 -0700, allber...@gmail.com wrote:
> > I think the problem is that there's already another syntax using that
> > sequence: coercion types. FF(FF(2)) is being parsed as a coercion
> > type from
> > FF to FF(... and then it falls over because it's not expecting nested
> > coercion types.
> >
> > On Tue, Aug 30, 2016 at 7:13 PM, Brian S. Julin <
> > perl6-bugs-follo...@perl.org> wrote:
> >
> > > # New Ticket Created by  "Brian S. Julin"
> > > # Please include the string:  [perl #129142]
> > > # in the subject line of all future correspondence about this
> > > issue.
> > > # https://rt.perl.org/Ticket/Display.html?id=129142 >
> > >
> > >
> > >
> > >
> > > $ perl6 -e 'enum FF ; FF(2).perl.say'
> > > FF::two
> > > $ perl6 -e 'enum FF ; FF(FF::two).perl.say'
> > > FF::two
> > > $ perl6 -e 'enum FF ; FF(two).perl.say'
> > > FF::two
> > > $ perl6 -e 'enum FF ; FF(abs(-2)).perl.say'
> > > FF::two
> > > $ perl6 -e 'enum FF ; FF(FF(2)).perl.say'
> > > ===SORRY!=== Error while compiling -e
> > > Unable to parse expression in typename; couldn't find final ')'
> > > at -e:1
> > > --> enum FF ; FF(FF(⏏2)).perl.say
> > >
> > >
> > > # o.O
> > > $ perl6 -e 'enum FF ; enum GG  > > fum>;
> > > FF(foo).perl.say'
> > > FF
> > >
> > > $ perl6 -e 'enum FF ; enum GG  > > fum>;
> > > FF(GG(foo)).perl.say'
> > > FF(GG(GG))
> > >
> > > $ perl6 -e 'enum FF ; enum GG  > > fum>;
> > > FF(GG(2)).perl.say'
> > > ===SORRY!=== Error while compiling -e
> > > Unable to parse expression in typename; couldn't find final ')'
> > > at -e:1
> > > --> hree>; enum GG ; FF(GG(⏏2)).perl.say
> > >
> >
> >
> >
> 
> Fixed with commit
> https://github.com/rakudo/rakudo/commit/c76d9324a9f67e4075683e38a63a9788161c17cc

Test added with commit 
https://github.com/perl6/roast/commit/3b1e5fb4f10ffb1ef384616013d89d117cc98a31


[perl #129142] [BUG] Parse error when coercing an enum from a coercion of an enum from an int

2018-03-16 Thread Jan-Olof Hendig via RT
On Tue, 30 Aug 2016 16:30:24 -0700, allber...@gmail.com wrote:
> I think the problem is that there's already another syntax using that
> sequence: coercion types. FF(FF(2)) is being parsed as a coercion type from
> FF to FF(... and then it falls over because it's not expecting nested
> coercion types.
> 
> On Tue, Aug 30, 2016 at 7:13 PM, Brian S. Julin <
> perl6-bugs-follo...@perl.org> wrote:
> 
> > # New Ticket Created by  "Brian S. Julin"
> > # Please include the string:  [perl #129142]
> > # in the subject line of all future correspondence about this issue.
> > # https://rt.perl.org/Ticket/Display.html?id=129142 >
> >
> >
> >
> >
> > $ perl6 -e 'enum FF ; FF(2).perl.say'
> > FF::two
> > $ perl6 -e 'enum FF ; FF(FF::two).perl.say'
> > FF::two
> > $ perl6 -e 'enum FF ; FF(two).perl.say'
> > FF::two
> > $ perl6 -e 'enum FF ; FF(abs(-2)).perl.say'
> > FF::two
> > $ perl6 -e 'enum FF ; FF(FF(2)).perl.say'
> > ===SORRY!=== Error while compiling -e
> > Unable to parse expression in typename; couldn't find final ')'
> > at -e:1
> > --> enum FF ; FF(FF(⏏2)).perl.say
> >
> >
> > # o.O
> > $ perl6 -e 'enum FF ; enum GG ;
> > FF(foo).perl.say'
> > FF
> >
> > $ perl6 -e 'enum FF ; enum GG ;
> > FF(GG(foo)).perl.say'
> > FF(GG(GG))
> >
> > $ perl6 -e 'enum FF ; enum GG ;
> > FF(GG(2)).perl.say'
> > ===SORRY!=== Error while compiling -e
> > Unable to parse expression in typename; couldn't find final ')'
> > at -e:1
> > --> hree>; enum GG ; FF(GG(⏏2)).perl.say
> >
> 
> 
> 

Fixed with commit 
https://github.com/rakudo/rakudo/commit/c76d9324a9f67e4075683e38a63a9788161c17cc