           # log "done unifying one"
 
         # have to promote constraints from just compiled dependencies
-        depConstraints = concat (for dep in binding.deps or [] when cononicalType = ctx.finalType dep.id, dep.scopeIndex
-          constraintsFromCanonicalType ctx, cononicalType, dep.type)
+        depConstraints = concat (for dep in binding.deps or [] when not dep.defining and depCanonicalType = ctx.finalType dep.id, dep.scopeIndex
+          constraintsFromCanonicalType ctx, depCanonicalType, dep.type)
         allConstraints = (join binding.constraints or [], depConstraints)
 
         # If the thing is not declared it must be coming from an outer scope

        currentType
        scopeIndex
      if not success
        return
      [deferredConstraints, retainedConstraints] = success
      # Finalizing type again after possibly added substitution when defer constraints
      currentType = type#substitute ctx.substitution, type

          #   return #{compiledBody};
          # })"""
          (irFunction
            name: name
            params: paramNames
            body: (join nonLiftedWheres, [(jsReturn compiledBody)]))
            # (jsCall "λ#{paramNames.length}", [
