E1020

E1020#

Invalid pragma. The pragma either has invalid id, or has invalid properties.

MoonBit compiler support the following pragmas:

  • @alert. This pragma is used to emit a warning message. It has the following format: @alert <category> "message". For example:

    ///|
    /// @alert deprecated "This function is deprecated"
    fn deprecated_function() {
      // ...
    }
    
  • @coverage.skip. This pragma indicates that the following declaration should be skipped when calculating code coverage. It has the following format: @coverage.skip. For example:

    ///|
    /// @coverage.skip
    fn function_to_skip() {
      // ...
    }
    

Erroneous example#

///|
/// @deprecated "This function is deprecated"
fn f() {
  // ...
}

Suggestion#

Depending on the pragma you want to use, you should either remove the invalid pragma, or replace it with a valid one.

///|
/// @alert deprecated "This function is deprecated"
fn f() {
  // ...
}