   toClassName = (c) -> c.className
   classParams = ctx.classParamsForType constraint
   throw new Error "No params for #{safePrintType constraint}" unless classParams
+  # return "{}" unless classParams
   for className, dict of values classParams
     if chain = findSuperClassChain ctx, className, constraint.className
       return accessList dict, chain

# Returns deferred and retained constraints
deferConstraints = (ctx, constraints) ->
  reducedConstraints = reduceConstraints ctx, constraints
  throw new Error "could not reduce constraints in deferConstraints" unless reducedConstraints
  fixedVars = ctx.allBoundTypeVariables()
  impliedConstraints = substituteList ctx.substitution, reducedConstraints
  isFixed = (constraint) ->
    # log fixedVars, (printType constraint), (findUnconstrained constraint)
    isSubset fixedVars, (findUnconstrained constraint)
  [deferred, retained] = partition isFixed, impliedConstraints
  # TODO: handle ambiguity when reducedConstraints include variables not in
  # fixedVars or quantifiedVars
  [deferred, retained]

reduceConstraints = (ctx, constraints) ->
  normalized = normalizeConstraints ctx, constraints
  if normalized
    simplifyConstraints ctx, normalized
  else
    null

# Normalized constraints have a type variable in their head, they are "abstract"
# and don't match any one instance

    if toMatchTypes (freshInstance ctx, type).type.types, constraint.types
      return validIdentifier name
  throw new Error "no instance for #{safePrintType constraint}"
  # return {}

irFunction = ({name, params, body}) ->
  {ir: irFunctionTranslate, name, params, body}
