 
   deferredBindings: ->
     @_scope().deferredBindings
+
+  currentDeclarationId: (name) ->
+    (@_declarationInCurrentScope name)?.id
 
   declarationId: (name) ->
     (@_declaration name)?.id

      # log "adding types", (map _symbol, params), paramTypes
      ctx.declareTyped paramNames, paramTypes
      for param in params
        param.id = ctx.declarationId _symbol param

      # Declare wheres first so they properly shadow parent scope
      preDeclarePatterns ctx, _fst unzip pairs wheres

  typeOrConstraint

mutateMarkingOrigin = (typeOrConstraint, expression) ->
  # typeOrConstraint.origin = expression

# Clones constrained types and parts of them
# Class constraint arguments are not cloned
