Skip to content

Commit

Permalink
fix: allow multiple declareBuiltin per declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
Kha committed May 23, 2024
1 parent 2509941 commit dfb496a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Lean/Compiler/InitAttr.lean
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Authors: Leonardo de Moura
-/
prelude
import Lean.AddDecl
import Lean.MonadEnv
import Lean.Elab.InfoTree.Main

namespace Lean
Expand Down Expand Up @@ -139,7 +140,7 @@ def setBuiltinInitAttr (env : Environment) (declName : Name) (initFnName : Name
builtinInitAttr.setParam env declName initFnName

def declareBuiltin (forDecl : Name) (value : Expr) : CoreM Unit := do
let name := `_regBuiltin ++ forDecl
let name ← mkAuxName (`_regBuiltin ++ forDecl) 1
let type := mkApp (mkConst `IO) (mkConst `Unit)
let decl := Declaration.defnDecl { name, levelParams := [], type, value, hints := ReducibilityHints.opaque,
safety := DefinitionSafety.safe }
Expand Down

0 comments on commit dfb496a

Please sign in to comment.