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

Reply via email to