Closed jchang0 closed 7 years ago
It looks like the first is just tripping up the Scala parser.
One attempt to solve it would be allowing is
s to chain, parsing as is (value1) {block1} .is (value2) {block2}
. However, that ends up in the same situation as when
and .elsewhen
, where if you omit the explicit dot, Scala parses block2
as an argument for value2
.
Will update the cheatsheet, this is bad.
Cheatsheet source updated. @chick or @ucbjrl, can one of you update the compiled version on the website?
@ducky64 website updated
By experimentation, it looks like the for the switch-is statement, the is statement must be on a different line than the closing brace of the previous is statement
e.g. this as written on the cheetsheet does not work: (it gives this compilation error message: overloaded method value apply with alternatives: (x: chisel3.core.UInt)chisel3.core.Bool (x: Int)chisel3.core.Bool (x: BigInt)chisel3.core.Bool cannot be applied to (Unit))
But if I put the is statement on a different line, it works:
Not sure if it's documentation error or chisel3 issue.