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

[Bug][Feature] Move compiler giving a warning or error for unknown attributes #9610

Closed
junkil-park opened this issue Aug 10, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@junkil-park
Copy link
Contributor

🐛 Bug

The Move compiler currently ignores unknown attributes. For example, the following code uses #[testonly] which is a typo of #[test_only]. This can leak some test-only code into the production.

#[testonly]
    /// For functions that approximate a value it's useful to test a value is close
    /// to the most correct value up to last digit
    fun assert_approx_the_same(x: u128, y: u128, precission: u64) {
        if (x < y) {
            let tmp = x;
            x = y;
            y = tmp;
        };
        let mult = (pow(10, precission) as u128);
        assert!((x - y) * mult < x, 0);
    }
@junkil-park junkil-park added the bug Something isn't working label Aug 10, 2023
@brmataptos
Copy link
Contributor

This redundant with #8875

@brmataptos
Copy link
Contributor

duplicate of #8875.

@brmataptos brmataptos closed this as not planned Won't fix, can't repro, duplicate, stale Aug 11, 2023
@github-project-automation github-project-automation bot moved this from 🆕 New to ✅ Done in Move Language and Runtime Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants