title: Scala Macro: get param default value
body: <p>I have the next code, and i would like to extract the default parametr from value.</p>
  
  <pre><code>//
  def extractor[T] = macro extractorImpl[T]
  
  def extractorImpl[T: c.WeakTypeTag](c: Context) = {
    //first i got a type contructor
    ???
  }
  </code></pre>
  
  <p>i try with <code>attachments</code> but <code>attachments.all</code> return a <code>Set[Any]</code> with (for example) <code>SymbolSourceAttachment(val name: String = "new name")</code> </p>
  
  <p><code>SymbolSourceAttachment</code> contain <code>ValDef</code> but i do not know how to extract from <code>SymbolSourceAttachment</code> <code>ValDef</code>.</p>
  
  <p>By the way i should to get a <code>Map[String, String]("name" -&gt; "new name")</code></p>
  
  <p>Example:</p>
  
  <pre><code>case class Person(name: String = "new name")
  
  object Macro {
    def extractor[T] = macro extractorImpl[T]
  
    def extractorImpl[T: c.WeakTypeTag](c: Context) = {
      import c.universe._
  
      c.weakTypeOf[T].declarations.collect {
        case a: MethodSymbol if a.isConstructor =&gt;
          a.paramss.collect {
            case b =&gt; b.collect {
              case c =&gt;
                c.attachments.all {
                  case d =&gt; println(showRaw(d)) // =&gt; SymbolSourceAttachment(val name: String = "new name")  
                }
            }
          }
        }
     } 
  }
  </code></pre>
  
  <p>And macro should return <code>Map("name" -&gt; "new name")</code></p>