 declaredTypeMissingConstraint = (ctx, name, constraint) ->
   ctx.extendSubstitution substitutionFail
     message: "#{name}'s declared type is too weak, missing #{printType replaceQuantifiedByOrigin constraint}"
-    conflicts: [(originOf constraint), (originOf constraint.types.types[0])]
+    conflicts: [constraint, constraint.types.types[0]]
 
 replaceQuantifiedByOrigin = (type) ->
   if type.QuantifiedVar

  [first, second] = sortBasedOnOriginPosition t1, t2
  substitutionFail
    message: "#{message} #{(safePrintType first)}, #{(safePrintType second)}"
    conflicts: [(originOf first), (originOf second)]
    types: [t1, t2]

sortBasedOnOriginPosition = (t1, t2) ->

  if _notEmpty ambiguous
    {error: substitutionFail
      message: "Constraint #{printType ambiguous[0]} is ambiguous for inferred type #{printType finalType}"
      conflicts: [type.type, ambiguous[0]]}
  else
    success: [deferred, retained]

