Open Argannor opened 4 years ago
@Argannor Unit expression operands are limited to identifiers, literals, and parenthesized expressions. With test G since the expression on the left is an identifier and the one on the right is parenthesized, there is otherwise an ambiguity wrt a method call expression, thus that particular use-case is not supported. Perhaps this will be supported with a more advanced expression parser in a future release.
@rsmckinney thank you for the quick reply. Sounds reasonable, in this case this is more of a feature request than a bug report.
As outlined above i don't think test G should be supported, B and C however would make operator overloading valuable for creating DSLs which can be neatly integrated in one's Java code. Therefore I'd be happy to see this in the future.
Do you want me to rephrase the original issue as a feature request?
Do you want me to rephrase the original issue as a feature request?
Go for it. Thanks.
Feature Request In order to allow for operator overloading (specifically prefixBind) to be used in building DSLs it would be nice to support Field Access Expressions. This would also make prefixBind more intuitive for developers, as we're used to field access having precedence over any operators.
Therefore I'd propose supporting the following two cases:
Edit 05.10.2020: Rewritten from a bug report to a feature request.