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

but keyword ought to be associative #2662

Open
fecundf opened this issue Jan 30, 2019 · 0 comments

Comments

Projects
None yet
1 participant
@fecundf
Copy link

commented Jan 30, 2019

The Problem

use v6;

role Diva { }
role Violinist { }
class Puppy { }

class Wonder-Dog is Puppy does Diva does Violinist { }

my $best_friend = Puppy.new but (Violinist, Diva);

our $companion = (Puppy.new but Violinist) but Diva;

# Everything above works, but the below line fails with
# Operators 'but' and 'but' are non-associative and require parentheses
my $quizzical = Puppy.new but Violinist but Diva;

Expected Behavior

$thing but Role1 but Role2 should be the same as $thing but (Role1, Role2), working similarly to does, and not require the parens as in ($thing but Role1) but Role2

Actual Behavior

Operators 'but' and 'but' are non-associative and require parentheses

Environment

This is Rakudo Star version 2018.10 built on MoarVM version 2018.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.