 
 
 class MemberField
-  constructor: (@_parent, @_name, @_type, @_def) ->
+  constructor: (@_parent, @_name, @_def) ->
   name: ->
     @_name
   label: ->

      @_appendFields(res, res.fields(), def.type.members, def)
      res
    else
      new ValueMemberField(parent, name, type, def)
  _appendFields: (parent, target, members) ->
    for name, def of members
      target.push @_buildMemberField(parent, name, def)

  _jsonDef: ->
    @_def
  type: ->
    @_def.type?.kind || @_def.type
  isStruct: ->
    @type() == 'struct'
  path: ->
    (if @_parent then @_parent.path() else []).concat(@_name)

class ValueMemberField extends MemberField
  constructor: (parent, name, def) ->
    super(parent, name, def)
  visit: (callback) ->
    callback(@)

class StructMemberField extends MemberField
  constructor: (parent, name, def) ->
    super(parent, name, def)
    @_fields = [] # Array of MemberField
  fields: ->
    @_fields
