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

        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

          # log "done unifying one"

        # have to promote constraints from just compiled dependencies
        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
