 ###
 module.exports = class AbstractTypeAttributes
   merge: (attrs)->
-    for k,v of attrs
-      @[k] = v
+    for name, attr of attrs
+      attr = type:attr if isString attr
+      vAttr = @[name]
+      if vAttr is undefined
+        @[name] = attr
+      else
+        vAttr[k] = v for k, v of attr
     return
   _initialize: (aOptions)-> @merge(aOptions)
   initialize: (aOptions)->

      continue if v in aExclude
      #continue if aSerialized and (k[0] is '$')
      vAttr = @[k]
      if k is 'name'
        vName = src[v] || src.name
        dest.name = vName if vName and vName isnt dest.name
      else if src[v] isnt undefined
        if @Type and vAttr.type? and src[v]? and src[v] isnt vAttr.value
          vType = @Type vAttr.type
          if vType and not vType.isValid src[v]
            k = "assign attribute '#{v}' error"
            if vType.errors.length
              k += ": the value #{src[v]}"
              for v in vType.errors
                k += "\n #{v.name}: #{v.message}"
              dest.errors = vType.errors if dest.errors

        # aSerialized and src[v] isnt vAttr.value:
        #  the parametric type object(options) do not need the defaults value.
        # but the mergeOptions need all attriubtes!!
        if !isFunction(vAttr.assign) or !vAttr.assign(dest, src, vValue, v)
          dest[v] = vValue
    return dest
  isOriginal: (aObject)->
    result = true
