scaladoc マクロ の仕組みを理解しようとしています。例えば
/** $DESCR
*
* @define DESCR
* A `Consumer` simplifies resource management...
*
* @define KEY
* the key type
*
* @define VALUE
* the value type
*/
object Consumer {
/** Creates a new consumer
*
* @tparam A $KEY
* @tparam B $VALUE
*/
def apply[A, B](): Consumer[A, B] = ???
}
/** $DESCR
*
* @tparam A $KEY
* @tparam B $VALUE
*/
trait Consumer[-A, +B]
私は、これはトレイトとコンパニオン オブジェクトの両方の説明を含むドキュメントを生成する必要があるという印象を受けました。またA Consumer simplifies resource management...
、apply
メソッドとtrait
.
しかし、マクロは特性では利用できないようです。オブジェクトは正しく文書化されていますが、trait doc にはマクロ名$DESCR
, $KEY
,が表示されているだけ$VALUE
です。