-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use forall
on arrays with elements of used-defined type
#98
Comments
It also appears that fully qualified name is also not an option due to bug in grammar: https://github.com/ConsenSys/scribble/blob/3a78ad19c294a81503aa63a57f2c90b9c77b44df/src/spec-lang/expr_grammar.pegjs#L623-L625 There is no return makeUserDefinedType(base.name + '.' + field.name, options, location()); With local fix:
that is produced by |
Still, we curretly support only index/key types in contract Test {
struct MyStruct {
uint i;
}
///#if_succeeds forall(uint256 i in arg) arg[i].i > 0;
function example(MyStruct[] calldata arg) public returns (bool) {
return true;
}
}
It seems that docs are the source of confusion. However we also better to produce clear errors to state what Scribble allows in such cases. I will leave the issue open, as there are few smaller bugs, that need to be addressed in order to explicitly state what |
@blitz-1306 is correct, the bug is in the grammar. The rule for
Note that both cases were wrong. In addition our error message is kinda poor here:
|
Consider the following sample:
Expected Scribble to be able to handle user-defined types in
forall
but got crash:Looking into a stacktrace gives that there is an issue with
resolveAny()
in solc-typed-ast. However we should clarify if such things expected to work and cover functionality by test samples.The text was updated successfully, but these errors were encountered: