Annotation Interface NoDiscard


Marks a method as returning a value that must be used. The WPILib compiler plugin will check for uses of methods with this annotation and report a compiler error if the value is unused. Marking a class or interface as @NoDiscard will act as if any method that returns that type or any subclass or implementor of that type has been marked with @NoDiscard.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    An error message to display if the return value is not used.
  • Element Details

    • value

      An error message to display if the return value is not used.
      Returns:
      The error message.
      Default:
      ""