Search
[Scala] Runtime error occurs though syntax should be correct
- M.R

- Jan 4, 2024
- 1 min read
Phenomenon
When I build and run a project written with scala + chisel, the following error occurred.
java.lang.IllegalArgumentException: requirement failed: BitPats must be in binary and be prefixed with 'b’
The message says that BitPat's syntax is wrong (start with b), but no matter how many times I look at it, the syntax is correct
Cause and solution
The error was not in the line where the error occurred, but in the syntax of another BitPat in the same class.
In other words, variable 'a' in the line where the error occurs is defined in SomeClass, the syntax of 'a' is correct, but the syntax of variable b in the same SomeClass is incorrect.
When I fix this, the problem was resolved.






Comments