Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error when coercing an enum from a coercion of an enum from an int #5627

Closed
p6rt opened this issue Aug 30, 2016 · 6 comments
Closed

Parse error when coercing an enum from a coercion of an enum from an int #5627

p6rt opened this issue Aug 30, 2016 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Aug 30, 2016

Migrated from rt.perl.org#129142 (status was 'resolved')

Searchable as RT129142$

@p6rt
Copy link
Author

p6rt commented Aug 30, 2016

From @skids

$ perl6 -e 'enum FF <zero one two three>; FF(2).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; FF(FF​::two).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; FF(two).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; FF(abs(-2)).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; 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 <zero one two three>; FF(FF(⏏2)).perl.say

# o.O
$ perl6 -e 'enum FF <zero one two three>; enum GG <fee fie foo fum>; FF(foo).perl.say'
FF

$ perl6 -e 'enum FF <zero one two three>; enum GG <fee fie foo fum>; FF(GG(foo)).perl.say'
FF(GG(GG))

$ perl6 -e 'enum FF <zero one two three>; enum GG <fee fie foo 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 <fee fie foo fum>; FF(GG(⏏2)).perl.say

@p6rt
Copy link
Author

p6rt commented Aug 30, 2016

From @geekosaur

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-followup@​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.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=129142 >

$ perl6 -e 'enum FF <zero one two three>; FF(2).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; FF(FF​::two).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; FF(two).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; FF(abs(-2)).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; 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 <zero one two three>; FF(FF(⏏2)).perl.say

# o.O
$ perl6 -e 'enum FF <zero one two three>; enum GG <fee fie foo fum>;
FF(foo).perl.say'
FF

$ perl6 -e 'enum FF <zero one two three>; enum GG <fee fie foo fum>;
FF(GG(foo)).perl.say'
FF(GG(GG))

$ perl6 -e 'enum FF <zero one two three>; enum GG <fee fie foo 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 <fee fie foo fum>; FF(GG(⏏2)).perl.say

--
brandon s allbery kf8nh sine nomine associates
allbery.b@​gmail.com ballbery@​sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

@p6rt
Copy link
Author

p6rt commented Aug 30, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Mar 16, 2018

From @dogbert17

On Tue, 30 Aug 2016 16​:30​:24 -0700, allbery.b@​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-followup@​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.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=129142 >

$ perl6 -e 'enum FF <zero one two three>; FF(2).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; FF(FF​::two).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; FF(two).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; FF(abs(-2)).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; 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 <zero one two three>; FF(FF(⏏2)).perl.say

# o.O
$ perl6 -e 'enum FF <zero one two three>; enum GG <fee fie foo fum>;
FF(foo).perl.say'
FF

$ perl6 -e 'enum FF <zero one two three>; enum GG <fee fie foo fum>;
FF(GG(foo)).perl.say'
FF(GG(GG))

$ perl6 -e 'enum FF <zero one two three>; enum GG <fee fie foo 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 <fee fie foo fum>; FF(GG(⏏2)).perl.say

Fixed with commit rakudo/rakudo@c76d932

@p6rt
Copy link
Author

p6rt commented Apr 7, 2018

From @dogbert17

On Fri, 16 Mar 2018 16​:02​:15 -0700, jan-olof.hendig@​bredband.net wrote​:

On Tue, 30 Aug 2016 16​:30​:24 -0700, allbery.b@​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-followup@​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.
# <URL​: https://rt-archive.perl.org/perl6/Ticket/Display.html?id=129142 >

$ perl6 -e 'enum FF <zero one two three>; FF(2).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; FF(FF​::two).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; FF(two).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; FF(abs(-2)).perl.say'
FF​::two
$ perl6 -e 'enum FF <zero one two three>; 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 <zero one two three>; FF(FF(⏏2)).perl.say

# o.O
$ perl6 -e 'enum FF <zero one two three>; enum GG <fee fie foo
fum>;
FF(foo).perl.say'
FF

$ perl6 -e 'enum FF <zero one two three>; enum GG <fee fie foo
fum>;
FF(GG(foo)).perl.say'
FF(GG(GG))

$ perl6 -e 'enum FF <zero one two three>; enum GG <fee fie foo
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 <fee fie foo fum>; FF(GG(⏏2)).perl.say

Fixed with commit
rakudo/rakudo@c76d932

Test added with commit Raku/roast@3b1e5fb

@p6rt p6rt closed this as completed Apr 7, 2018
@p6rt
Copy link
Author

p6rt commented Apr 7, 2018

@dogbert17 - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant