 
 findMatchingDefinitionsOnType = (type, definitionLists) ->
   ctx = new Context
+  console.log definitionLists
   [typed, untyped] = unzip (for definitions, i in definitionLists
     isValid = (name, def) ->
       def.type? and not def.type.TempType

  bindTypeVariables: (vars) ->
    addAllToSet @_scope().boundTypeVariables, vars

  bindTypeVariablesToOuterScope: (vars) ->
    addAllToSet @_outerScope().boundTypeVariables, vars

  allBoundTypeVariables: ->
    substituteVarNames this, concatSets (for scope in @scopes[...-1]
      scope.boundTypeVariables)...

  addToScopeConstraints: (constraints) ->

      id = (ctx.definitionName() and ctx.definitionId()) ?
        (ctx.currentDeclarationId symbol) ? ctx.freshId()
      type = toConstrained ctx.freshTypeVariable star
      # ctx.bindTypeVariables [type.type.name]
      ctx.addToDefinedNames {name: symbol, id: id, type: type}
      type: type
      id: id
