       ctx.extendSubstitution substitution
       return map ((c) -> substitute substitution, c), freshed.constraints
   null
+
+instanceLookupFailed = (constraint) ->
+  [first, second] = sortBasedOnOriginPosition constraint, constraint.types.types[0]
+  substitutionFail
+    message: "No instance found to satisfy #{safePrintType constraint}"
+    conflicts: [first.origin, second.origin]
 
 _names = (list) ->
   map _symbol, list

    newSubstitution variable.name, type

typeFail = (message, t1, t2) ->
  [first, second] =
    if t1.origin?.start > t2.origin?.start
      [t2, t1]
    else
      [t1, t2]
  substitutionFail
    message: "#{message} #{(safePrintType first)}, #{(safePrintType second)}"
    conflicts: [first.origin, second.origin]


# Maybe substitution if the types match

    #   constraintsFromCanonicalType ctx, declaredType, finalType
    # else
      (reduceConstraints ctx, allConstraints).success
  if not reducedConstraints
    return jsNoop()
  if bare and _notEmpty reducedConstraints
    malformed ctx, expression, "Ambiguous class constraints: #{map safePrintType, reducedConstraints}"
    return "null";
