Skip to content
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

assert does not work as in documentation #9

Open
utdrmac opened this issue Feb 21, 2019 · 2 comments
Open

assert does not work as in documentation #9

utdrmac opened this issue Feb 21, 2019 · 2 comments

Comments

@utdrmac
Copy link

utdrmac commented Feb 21, 2019

Consider the following fi code:

const address MY_ADD "tz1R5QtyaUKV4az8YpGGKVhe8Wf7rou9SaVa";

entry a(){
    if (MY_ADD != address "tz1NogVV7RShvFq3nd1vgxRKu1ocZKofGmmm") {
        throw(string "DUDE THATs NOT ME");
    }
    assert(MY_ADD != address "tz1NogVV7RShvFq3nd1vgxRKu1ocZKofGmmm", string "NOPE");
}

This code will not compile. Gives "Syntax error in condition at line 4, character 70"
According to the assert documentation , this is correct syntax. If you comment out the line with the assert, compiles fine. If you remove the ,string "NOPE" aspect, it compiles fine.

@utdrmac
Copy link
Author

utdrmac commented Feb 21, 2019

This compiles:

const address MY_ADD "tz1R5QtyaUKV4az8YpGGKVhe8Wf7rou9SaVa";

entry a(){
    if (MY_ADD != address "tz1NogVV7RShvFq3nd1vgxRKu1ocZKofGmmm") {
        throw(string "DUDE THATs NOT ME");
    }
    assert(MY_ADD != address "tz1NogVV7RShvFq3nd1vgxRKu1ocZKofGmmm");
}

@stephenandrews
Copy link
Contributor

Thanks we'll get this fixed for the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants