An attempt to import an AST produced by the compiler fails when the original source code contains an inline assembly block with a variable declaration without an initializer:
test.sol
contract C {
function f() public pure {
assembly {
let x
}
}
}
solc test.sol --combined-json ast | solc --import-ast -
Failed to import AST: Expected "nodeType" to be of type string!
This is reproducible all the way down to 0.6.2, when the --import-ast option was introduced, though before 0.8.0 the error message was different and it seems to be failing for a different reason (even examples that work on 0.8.x fail on those versions)
Failed to import AST: Top-level node should be a 'SourceUnit'
Discovered by @aart in #13576 (comment).
An attempt to import an AST produced by the compiler fails when the original source code contains an inline assembly block with a variable declaration without an initializer:
test.solsolc test.sol --combined-json ast | solc --import-ast -This is reproducible all the way down to 0.6.2, when the
--import-astoption was introduced, though before 0.8.0 the error message was different and it seems to be failing for a different reason (even examples that work on 0.8.x fail on those versions)Discovered by @aart in #13576 (comment).