question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expression with side effect is not allowed in guards

See original GitHub issue

Describe 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 image

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:closed
  • Created 3 years ago
  • Comments:15 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
gallandarakhneorgcommented, Jun 18, 2020

I will change the tables into the documentation. Because the “code” column provides the code for @SuppressWarnings. But, it is incomplete.

1reaction
gallandarakhneorgcommented, Jun 17, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found