Where to start if you want to extend `Any`

You can make it work with optional chaining by making it an "assignment" operator:

precedencegroup LeftAssignmentPrecedence {
  associativity: left
  higherThan: BitwiseShiftPrecedence
  assignment: true
}

Though this feels like a bit of a hack as the operator doesn't actually perform any mutation of the left operand.

1 Like