         withOrigin (ctx.freshTypeVariable star), param
       paramTypeVars = map newParamType, params
       paramTypes = map (__ toForAll, toConstrained), paramTypeVars
+      ctx.newLateScope()
       ctx.bindTypeVariables (map (({name}) -> name), paramTypeVars)
-      ctx.newLateScope()
       # log "adding types", (map _symbol, params), paramTypes
       ctx.declareTyped paramNames, paramTypes
       for param in params

    if not ctx.isCurrentlyDeclared name
      ctx.declare name, id: id
    if deps.length > 0
      currentType = substitute ctx.substitution, type
      ctx.addToDeferred
        name: name

      ctx.addToDeferredNames {name: symbol, type: (mapOrigin type, atom)}
      nameTranslate ctx, atom, symbol, type
    else
      # log "deferring in rhs for #{symbol}", ctx._deferrableDefinition().name
      ctx.doDefer atom, symbol
      translation: deferredExpression()

