sway icon indicating copy to clipboard operation
sway copied to clipboard

Unrecognized annotations should be a compile error

Open mohammadfawaz opened this issue 3 years ago • 2 comments

Example:

contract;

abi MyContract {
    fn test_function();
}

impl MyContract for Contract {
    #[typo]
    fn test_function() {
    } 
}

This builds fine. However, we should probably be checking annotations against a table of recognized annotations in certain places. (e.g. only allow storage annotations on functions/methods but not on structs etc.)

mohammadfawaz avatar Aug 09 '22 16:08 mohammadfawaz

Fair enough, although it's probably just worth a warning rather than full on error.

otrho avatar Aug 09 '22 23:08 otrho

Fair enough, although it's probably just worth a warning rather than full on error.

A warning is a good option I suppose!

mohammadfawaz avatar Aug 10 '22 02:08 mohammadfawaz