You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
contract Test {
function test() external {
int i = 0;
if (false) {} else i == 0 ? i = 0 : i--;
}
}
Result:
❯ npx hardhat coverage
Version
=======
> solidity-coverage: v0.8.5
Instrumenting for coverage...
=============================
> Test.sol
Compilation:
============
ParserError: Expected ',' but got ';'
--> contracts/Test.sol:22:51:
|
22 | else {((c_e76f6567(0x46bcacc667e80bd0); /* branch */
| ^
Error in plugin solidity-coverage: HardhatError: HH600: Compilation failed
For more info run Hardhat with --show-stack-traces
The text was updated successfully, but these errors were encountered:
@PfanP Will take a look at this asap. It's possible you could work around this error by explicitly bracketing the else, e.g rewriting the original example like:
contractTest {
function test() external {
int i =0;
if (false) {
} else {
i ==0? i =0 : i--;
}
}
}
If that fails, as a last resort you should be able to use conventional if/else for the ternary conditional.
PoC:
Result:
The text was updated successfully, but these errors were encountered: