Function argument annotations

The Gosu language supports annotations on method parameters, including Gosu block declarations. In some cases, you need to explicitly add uses lines to declare the annotation class to use.

For example:

package doc.example

uses doc.example.annotations.MyAnnotation

class TestABC {

  function add(@MyAnnotation a : Integer, b : Integer) : Integer {
    return a + b
  }

  function addAndLog(@Deprecated a : Integer, b : Integer) : Integer {
    return a + b
  }
}
Note: Gosu does not support special compiler or IDE behavior for Java 8 Type annotations such as @m, @Nonnull, @ReadOnly, @Regex, @Tainted, and @Untainted.

See also