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

Roast rakudo skip/todo test:./S06-operator-overloading/sub.t line:137 reason: cannot bind with this LHS #4128

Open
p6rt opened this issue May 3, 2015 · 2 comments

Comments

@p6rt
Copy link

p6rt commented May 3, 2015

Migrated from rt.perl.org#124979 (status was 'open')

Searchable as RT124979$

@p6rt
Copy link
Author

p6rt commented Dec 7, 2017

From @tisonkun

This is not limited in operator overloading

```
my $a;
$a := { $^a + $^b }
# ok
```

```
my &a;
&a := { $^a + $^b }
# Cannot use bind operator with this left-hand side
```

```
my &a := { $^a + $^b }
say a(1, 2)
# 3
```

```
my &infix​:<plus> := { $^a + $^b };

say 1 plus 2 plus 3

# 6
```

Note that it is all well if use `=` instead of `​:=`

```
{
  my &infix​:<plus>;
  BEGIN {
  &infix​:<plus> = { $^a + $^b };
  }

  is 3 plus 5, 8, 'overloading an operator using "my &infix​:<...>" worked';
}
# ok 1 - overloading an operator using "my &infix​:<...>" worked
```

This test is moved to S06-operator-overloading/infix.t, BTW

@p6rt
Copy link
Author

p6rt commented Dec 7, 2017

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

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

No branches or pull requests

1 participant