   @hasDefinition: (name) -> findDefinition name, this
 
   @define: (name, options, mapAliases = true) ->
-    @definitions ?= {}
+    @_definitions ?= {}
 
     if options
       type = options.as or options.type or {}



findDefinition = (name, context) ->
  definition = findLocalDefinition name, context.definitions

  return definition if definition

  parent = context.__super__?.constructor
  if parent and parent.definitions
    definition = findDefinition name, parent

  definition


  @extend: (statics) ->
    class Result extends this
    Result.mixin(statics) if statics
    Result._definitions = {}
    Result

  @mixin: (obj) ->
    for own name, prop of obj._definitions
      @_definitions[name] = prop
      @_mapDefinitionAliases prop
    this

