| Summary: | [Xbase] short circuit for boolean arithmetic operators used with boolean types | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Sven Efftinge <sven.efftinge> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | maxim.frolov, rvonmassow, sebastian.zarnekow |
| Version: | 2.0.0 | Flags: | sven.efftinge:
indigo+
|
| Target Milestone: | M7 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| Whiteboard: | |||
|
Description
Sven Efftinge
*** Bug 342359 has been marked as a duplicate of this bug. *** (In reply to comment #0) > We need to support short circuit evaluation of boolean operators. > Unfortunately, this has to be baked into the language. An alternative would be to use annotations or some other kind of mapping information from extension methods to compiler / interpreter strategies, e.g. class BooleanExtension { @CompileStrategy(BooleanCompiler.class) @InterpreterStrategy(BooleanInterpreter.class) boolean operator_and(boolean left, boolean right) { return left && right; } } This would allow to create more intuitive code for other extensions, too, e.g. class IntExtension { int operator_plus(int left, int right) { return left + right; } } could be compiled to result = left + right; I don't think it is worth the added complexity. At least for Indigo we should simply hard code the special boolean case into the compiler and interpreter. *** Bug 342577 has been marked as a duplicate of this bug. *** pushed to master Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |