           ctx.assignArity name, paramNames
         else
           documentation = extractDocs docs
-          ctx.preDeclare name,
-            arity: paramNames
-            id: ctx.definitionId()
-            type: ctx.preDeclaredType name # if any
-            docs: documentation
+          if not ctx.isFinallyCurrentlyDeclared name
+            ctx.preDeclare name,
+              arity: paramNames
+              id: ctx.definitionId()
+              type: ctx.preDeclaredType name # if any
+              docs: documentation
 
       newParamType = (param) ->
         param.scope = ctx.currentScopeIndex()

      throw new Error "Macro #{name} already defined"
    else
      addToMap topScope.macros, name, macro
  for name, {type, arity, docs, isClass, virtual} of values definitions when shouldImport name
    addToMap topScope, name, {type, arity, docs, isClass, virtual}
  topScope.typeNames = concatMaps topScope.typeNames, typeNames
  topScope.classes = concatMaps topScope.classes, classes
  ctx.scopeIndex += compiledModule.savedScopes.length

  isFinallyTyped: (name, scopeIndex) ->
    !!@finalType name, scopeIndex

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

