Home > Blockchain >  Document a recurring argument with a built-in type
Document a recurring argument with a built-in type

Time:08-15

  • Several packages have multiple classes with methods that have an argument called p.
  • I want to document p.
  • I can't document the type of p because the type is built-in (e.g. Map[String, String]).

How to document p?

class A {
    def (p: Map[String, String]): Unit = {}
}

class B {
    def (p: Map[String, String], ...): Unit = {}  
}

CodePudding user response:

I think you are looking for type aliases:

/** Some doc for P type */
type MyPType = Map[String, String]

def someMethod(p: MyPType) = ...
  • Related