             docs: documentation
 
       newParamType = (param) ->
+        param.scope = ctx.currentScopeIndex()
         withOrigin (ctx.freshTypeVariable star), param
       paramTypeVars = map newParamType, params
       paramTypes = map (__ toForAll, toConstrained), paramTypeVars

  type: (name) ->
    (@_declaration name)?.type

  finalType: (name) ->
    (type = @type name) and (type not instanceof TempType) and type

  preDeclaredType: (name) ->
    (@_preDeclaration name)?.type

      currentType = substitute ctx.substitution, type
      ctx.addToDeferred
        name: name
        scopeIndex: ctx.currentScopeIndex()
        type: currentType
        constraints: constraints
        polymorphic: polymorphic
