Expression with side effect is not allowed in guards
See original GitHub issueDescribe the bug A clear and concise description of what the bug is.
Unecessary side-effect issue on behavior guards
To Reproduce
on E_MoveRandomly [occurrence.fromMe && (MT_getEntityState(occurrence.entity).routeLength > 0)] {
Expected behavior A clear and concise description of what you expected to happen.
Should work with no error
Screenshot
System configuration: – SARL version: 0.10.0 – SARL compiler: 0.10.0
-
- Eclipse compiler without Maven
-
- Eclipse compiler with Maven
-
- Maven compiler on the command line
-
- sarlc compiler – Java JDK version (with the manufacturer name): 1.8 Oracle – Operating System:
-
- Linux 64bits
-
- Windows 64bits
-
- MacOS 64bits
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (15 by maintainers)
Top Results From Across the Web
Guards – Elixir v1.6.0 - HexDocs
Not all expressions are allowed in guard clauses, but only a handful of them. This is a deliberate choice: only a predefined set...
Read more >"Invalid expression in guard, case is not allowed in guards" error
I have no clue why, all I can see is that ! is a macro (that can receive any argument) and not is...
Read more >[erlang-questions] Side-effects in "if" guards
In a "normal" expression, even ones only using the guard subset, an error generates an error which crashes the process if not caught...
Read more >What's a side-effect free expression in Timed Automata?
In that case, "side-effect free" means that the expressions which may occur in guards are restricted to not change any variable values (i.e....
Read more >Reasoning Behind Illegal If Guard Expression? - Erlang Forums
I am writing a function that will push a value to a list on a map if the key already exists, or init...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will change the tables into the documentation. Because the “code” column provides the code for
@SuppressWarnings
. But, it is incomplete.Dear @ssardina, regarding your comment about the list of all the errors that could be given by SARL, I have added this page for SARL, and this page for Janus. Both of them are accessible from several points into the documentation pages.
If you found that some explanaitions may be more detailed, please let us know.