       type = freshInstance ctx, contextType
       nameTranslate ctx, atom, symbol, type
     # In sub-scope (function) only defer compilation for declarations in current scope
-    else if (not ctx.isCurrentlyDeclared symbol) and
-        ((ctx.isFinallyDeclared symbol) or symbol in ctx.parentDeferrableDefinitionNames()) or
-          contextType instanceof TempType
+    else if ((not ctx.isCurrentlyDeclared symbol) and (ctx.arity symbol) and
+          ((ctx.isFinallyDeclared symbol) or symbol in ctx.parentDeferrableDefinitionNames())) or
+            contextType instanceof TempType
       # Typing deferred, use an impricise type var
       type = toConstrained ctx.freshTypeVariable star
       ctx.addToDeferredNames {name: symbol, type: (mapOrigin type, atom)}

  "null"


jsReturn = (arg) ->
  {js: jsReturnTranslate, arg}

jsReturnTranslate = ({arg}) ->
  "return #{arg};"


jsTernary = (cond, thenExp, elseExp) ->

  """
  'f', 7

  'constraints and deferring'
  """
  Show (class [a]
    show (fn [x] (: (Fn a String))))

  show-string (instance (Show String)
    show (fn [x] x))

  s (fn [y]
    (show y))

  f (fn [x]
    g)

  g "2"

  r (fn [y]
    (f (s y)))

  j (fn [x]
    (r "src"))
  """
  '(j 2)', "2"


  # TODO: support matching with the same name
  #       to implement this we need the iife to take as arguments all variables
