One can work around like this (I can’t be held responsible for any eye-rolling or horrified expressions that may follow):
include (
struct
let foo = 1
end :
sig
val foo : int [@@alert hey "there"]
end)
Looking at the docs, it seems that alerts are only for types or signature items. But I wonder if this is a fundamental technical limitation? Or a design decision?
The attributes page has an explanation and some examples of where and how the different incantations of [@@@ your_attribute_goes_here] apply. Worth checking out!