diff --git a/tests/lean/run/KyleAlg.lean b/tests/lean/run/KyleAlg.lean index c09630bf2a..4d1fab7666 100644 --- a/tests/lean/run/KyleAlg.lean +++ b/tests/lean/run/KyleAlg.lean @@ -262,7 +262,7 @@ def getDeclTypeValueDagSize (declName : Name) : CoreM Nat := do def reduceAndGetDagSize (declName : Name) : MetaM Nat := do let c := mkConst declName [levelOne] let e ← Meta.reduce c - trace[Meta.debug]! "{e}" + trace[Meta.debug] "{e}" e.dagSize #eval reduceAndGetDagSize `test1 diff --git a/tests/lean/run/closure1.lean b/tests/lean/run/closure1.lean index c8d6f3ab88..87dcba6f7d 100644 --- a/tests/lean/run/closure1.lean +++ b/tests/lean/run/closure1.lean @@ -13,7 +13,7 @@ set_option trace.Meta.debug true def printDef (declName : Name) : MetaM Unit := do let cinfo ← getConstInfo declName; -trace! `Meta.debug cinfo.value! +trace[Meta.debug] cinfo.value! def tst1 : MetaM Unit := do let u := mkLevelParam `u @@ -27,7 +27,7 @@ withLocalDeclD `f (← mkArrow α α) $ fun f => do withLetDecl `b α (mkApp f a) $ fun b => do let t := mkApp m2 (mkApp f b) let e ← mkAuxDefinitionFor `foo1 t -trace[Meta.debug]! e +trace[Meta.debug] e printDef `foo1 #eval tst1 @@ -43,7 +43,7 @@ withLocalDeclD `p (mkSort levelZero) $ fun p => do let t ← mkEq v1 v2 let t := mkApp2 (mkConst `And) t (mkApp2 (mkConst `Or) (mkApp m v2) p) let e ← mkAuxDefinitionFor `foo2 t -trace! `Meta.debug e +trace[Meta.debug] e printDef `foo2 #eval tst2 diff --git a/tests/lean/run/core.lean b/tests/lean/run/core.lean index 70002f8517..98f5250bf3 100644 --- a/tests/lean/run/core.lean +++ b/tests/lean/run/core.lean @@ -6,7 +6,7 @@ open Lean.Core def f : CoreM Nat := do let env ← getEnv; let cinfo ← getConstInfo `Nat.add; -trace! `Elab "trace message"; +trace[Elab] "trace message"; IO.println $ toString cinfo.type; IO.println "testing..."; pure 10; diff --git a/tests/lean/run/depElim1.lean b/tests/lean/run/depElim1.lean index ce13fc781d..27127e3ded 100644 --- a/tests/lean/run/depElim1.lean +++ b/tests/lean/run/depElim1.lean @@ -165,7 +165,7 @@ generalizeTelescope majors.toArray fun majors => do def test (ex : Name) (numPats : Nat) (elimName : Name) (inProp : Bool := false) : MetaM Unit := withDepElimFrom ex numPats fun majors alts => do let majors := majors.map mkFVar - trace[Meta.debug]! m!"majors: {majors.toArray}" + trace[Meta.debug] m!"majors: {majors.toArray}" let r ← mkTester elimName majors alts inProp unless r.counterExamples.isEmpty do throwError m!"missing cases:\n{counterExamplesToMessageData r.counterExamples}" diff --git a/tests/lean/run/generalizeTelescope.lean b/tests/lean/run/generalizeTelescope.lean index aaf7b41fbf..86d38404d5 100644 --- a/tests/lean/run/generalizeTelescope.lean +++ b/tests/lean/run/generalizeTelescope.lean @@ -19,7 +19,7 @@ let vecN1 := mkApp2 (mkConst `Vec) nat n1 withLocalDeclD `xs vecN1 fun xs => do generalizeTelescope #[n1, xs] fun ys => do let t ← mkLambdaFVars ys ys.back -trace! `Meta.debug t +trace[Meta.debug] t pure () #eval tst1 @@ -34,7 +34,7 @@ withLocalDeclD `xs vecN1 $ fun xs => do let e ← mkEqRefl xs generalizeTelescope #[n1, xs, e] fun ys => do let t ← mkLambdaFVars ys ys.back -trace! `Meta.debug t +trace[Meta.debug] t pure () #eval tst2 @@ -53,8 +53,8 @@ let e ← mkEqRefl xs failIfSuccess do generalizeTelescope #[n1, e] fun ys => do let t ← mkLambdaFVars ys ys.back - trace! `Meta.debug t + trace[Meta.debug] t pure () -trace! `Meta.debug "failed as expected" +trace[Meta.debug] "failed as expected" #eval tst3 diff --git a/tests/lean/run/genindices.lean b/tests/lean/run/genindices.lean index b39c35f718..da00729e34 100644 --- a/tests/lean/run/genindices.lean +++ b/tests/lean/run/genindices.lean @@ -14,12 +14,12 @@ def tst1 : MetaM Unit := do let cinfo ← getConstInfo `goal; let type := cinfo.type; let mvar ← mkFreshExprMVar type; -trace! `Elab (MessageData.ofGoal mvar.mvarId!); +trace[Elab] (MessageData.ofGoal mvar.mvarId!); let (_, mvarId) ← introN mvar.mvarId! 2; let (fvarId, mvarId) ← intro1 mvarId; -trace! `Elab (MessageData.ofGoal mvarId); +trace[Elab] (MessageData.ofGoal mvarId); let s ← generalizeIndices mvarId fvarId; -trace! `Elab (MessageData.ofGoal s.mvarId); +trace[Elab] (MessageData.ofGoal s.mvarId); pure () set_option trace.Elab true diff --git a/tests/lean/run/isDefEqCheckAssignmentBug.lean b/tests/lean/run/isDefEqCheckAssignmentBug.lean index 204d7291cd..fc829d6b69 100644 --- a/tests/lean/run/isDefEqCheckAssignmentBug.lean +++ b/tests/lean/run/isDefEqCheckAssignmentBug.lean @@ -8,17 +8,17 @@ def f (x : Type) := x def tst : MetaM Unit := do let m1 ← mkFreshExprMVar none withLocalDeclD `x m1 fun x => do - trace[Meta.debug]! "{x} : {← inferType x}" - trace[Meta.debug]! "{m1} : {← inferType m1}" + trace[Meta.debug] "{x} : {← inferType x}" + trace[Meta.debug] "{m1} : {← inferType m1}" let m2 ← mkFreshExprMVar (mkSort levelOne) let t ← mkAppM ``f #[m2] - trace[Meta.debug]! "{m2} : {← inferType m2}" + trace[Meta.debug] "{m2} : {← inferType m2}" unless (← fullApproxDefEq <| isDefEq m1 t) do -- m1 := f m3 -- where `m3` has a smaller scope than `m2` throwError! "isDefEq failed" - trace[Meta.debug]! "{m2} : {← inferType m2}" - trace[Meta.debug]! "{m1} : {← inferType m1}" + trace[Meta.debug] "{m2} : {← inferType m2}" + trace[Meta.debug] "{m1} : {← inferType m1}" let e ← mkForallFVars #[x] m2 -- `forall (x : f ?m2), ?m2` - trace[Meta.debug]! "{e} : {← e}" + trace[Meta.debug] "{e} : {← e}" return () set_option trace.Meta.isDefEq true diff --git a/tests/lean/run/meta2.lean b/tests/lean/run/meta2.lean index 7275f76482..a26336f192 100644 --- a/tests/lean/run/meta2.lean +++ b/tests/lean/run/meta2.lean @@ -8,7 +8,7 @@ open Lean.Meta set_option trace.Meta.debug true def print (msg : MessageData) : MetaM Unit := -trace! `Meta.debug msg +trace[Meta.debug] msg def checkM (x : MetaM Bool) : MetaM Unit := unless (← x) do throwError "check failed" diff --git a/tests/lean/run/meta3.lean b/tests/lean/run/meta3.lean index dfa85c0872..1e5c7eaa97 100644 --- a/tests/lean/run/meta3.lean +++ b/tests/lean/run/meta3.lean @@ -10,7 +10,7 @@ let opt := opt.setBool `trace.Meta true; opt def print (msg : MessageData) : MetaM Unit := -trace! `Meta.debug msg +trace[Meta.debug] msg def check (x : MetaM Bool) : MetaM Unit := unless (← x) do throwError "check failed" diff --git a/tests/lean/run/meta4.lean b/tests/lean/run/meta4.lean index 2e67b1580f..1d8e41e84e 100644 --- a/tests/lean/run/meta4.lean +++ b/tests/lean/run/meta4.lean @@ -4,7 +4,7 @@ open Lean open Lean.Meta def print (msg : MessageData) : MetaM Unit := -trace! `Meta.debug msg +trace[Meta.debug] msg def checkM (x : MetaM Bool) : MetaM Unit := unless (← x) do throwError "check failed" diff --git a/tests/lean/run/meta5.lean b/tests/lean/run/meta5.lean index 0bd4783959..4d9055705a 100644 --- a/tests/lean/run/meta5.lean +++ b/tests/lean/run/meta5.lean @@ -7,16 +7,16 @@ def tst1 : MetaM Unit := withLocalDeclD `y (mkConst `Nat) $ fun y => do withLetDecl `x (mkConst `Nat) (mkNatLit 0) $ fun x => do { let mvar ← mkFreshExprMVar (mkConst `Nat) MetavarKind.syntheticOpaque; - trace[Meta.debug]! mvar; + trace[Meta.debug] mvar; let r ← mkLambdaFVars #[y, x] mvar; - trace[Message.debug]! r; + trace[Message.debug] r; let v := mkApp2 (mkConst `Nat.add) x y; assignExprMVar mvar.mvarId! v; - trace[Meta.debug]! mvar; - trace[Meta.debug]! r; + trace[Meta.debug] mvar; + trace[Meta.debug] r; let mctx ← getMCtx; mctx.decls.forM fun mvarId mvarDecl => do - trace[Meta.debug]! m!"?{mvarId} : {mvarDecl.type}" + trace[Meta.debug] m!"?{mvarId} : {mvarDecl.type}" } set_option trace.Meta.debug true diff --git a/tests/lean/run/meta6.lean b/tests/lean/run/meta6.lean index 55f650772a..e23aa0f729 100644 --- a/tests/lean/run/meta6.lean +++ b/tests/lean/run/meta6.lean @@ -4,7 +4,7 @@ open Lean open Lean.Meta def print (msg : MessageData) : MetaM Unit := -trace! `Meta.debug msg +trace[Meta.debug] msg def checkM (x : MetaM Bool) : MetaM Unit := unless (← x) do throwError "check failed" diff --git a/tests/lean/run/meta7.lean b/tests/lean/run/meta7.lean index 287bbb6037..e659957e2d 100644 --- a/tests/lean/run/meta7.lean +++ b/tests/lean/run/meta7.lean @@ -11,7 +11,7 @@ set_option trace.Meta.debug true set_option trace.Meta.check false def print (msg : MessageData) : MetaM Unit := -trace! `Meta.debug msg +trace[Meta.debug] msg def checkM (x : MetaM Bool) : MetaM Unit := unless (← x) do throwError "check failed" diff --git a/tests/lean/run/recInfo1.lean b/tests/lean/run/recInfo1.lean index 97416fe367..fc00da5188 100644 --- a/tests/lean/run/recInfo1.lean +++ b/tests/lean/run/recInfo1.lean @@ -4,7 +4,7 @@ open Lean open Lean.Meta def print (msg : MessageData) : MetaM Unit := -trace! `Meta.debug msg +trace[Meta.debug] msg def showRecInfo (declName : Name) (majorPos? : Option Nat := none) : MetaM Unit := do let info ← mkRecursorInfo declName majorPos? diff --git a/tests/lean/run/simp1.lean b/tests/lean/run/simp1.lean index 61fe508cee..a82622f9a5 100644 --- a/tests/lean/run/simp1.lean +++ b/tests/lean/run/simp1.lean @@ -31,7 +31,7 @@ open Lean.Meta def tst1 : MetaM Unit := do let lemmas ← Meta.getSimpLemmas - trace[Meta.debug]! "{lemmas.pre}\n-----\n{lemmas.post}" + trace[Meta.debug] "{lemmas.pre}\n-----\n{lemmas.post}" set_option trace.Meta.debug true in #eval tst1 @@ -42,10 +42,10 @@ def tst2 : MetaM Unit := do match type.eq? with | none => throwError! "unexpected" | some (_, lhs, _) => - trace[Meta.debug]! "lhs: {lhs}" + trace[Meta.debug] "lhs: {lhs}" let s ← Meta.getSimpLemmas let m ← s.post.getMatch lhs - trace[Meta.debug]! "result: {m}" + trace[Meta.debug] "result: {m}" assert! m.any fun s => s.name? == `ex2 diff --git a/tests/lean/run/synth1.lean b/tests/lean/run/synth1.lean index 7227e97bff..767a7b7912 100644 --- a/tests/lean/run/synth1.lean +++ b/tests/lean/run/synth1.lean @@ -25,7 +25,7 @@ instance coerceNatToInt : HasCoerce Nat Int := ⟨fun x => Int.ofNat x⟩ def print {α} [ToString α] (a : α) : MetaM Unit := -trace! `Meta.synthInstance (toString a) +trace[Meta.synthInstance] (toString a) def tst1 : MetaM Unit := do diff --git a/tests/lean/run/tactic.lean b/tests/lean/run/tactic.lean index 9611104544..ec0e3df36f 100644 --- a/tests/lean/run/tactic.lean +++ b/tests/lean/run/tactic.lean @@ -7,7 +7,7 @@ open Lean.Meta axiom simple : forall {p q : Prop}, p → q → p def print (msg : MessageData) : MetaM Unit := -trace! `Meta.Tactic msg +trace[Meta.Tactic] msg def tst1 : MetaM Unit := do let cinfo ← getConstInfo `simple diff --git a/tests/lean/run/trace.lean b/tests/lean/run/trace.lean index 7435713f35..54c1dbb569 100644 --- a/tests/lean/run/trace.lean +++ b/tests/lean/run/trace.lean @@ -9,14 +9,14 @@ structure MyState := abbrev M := CoreM def tst1 : M Unit := -do trace! `module (m!"hello" ++ MessageData.nest 9 (m!"\n" ++ "world")); - trace! `module.aux "another message"; +do trace[module] (m!"hello" ++ MessageData.nest 9 (m!"\n" ++ "world")); + trace[module.aux] "another message"; pure () def tst2 (b : Bool) : M Unit := traceCtx `module $ do tst1; - trace! `bughunt "at test2"; + trace[bughunt] "at test2"; when b $ throwError "error"; tst1; pure () @@ -34,10 +34,10 @@ do traceCtx `module $ do { tst2 b; tst1 }; - trace! `bughunt "at end of tst3"; + trace[bughunt] "at end of tst3"; -- Messages are computed lazily. The following message will only be computed -- if `trace.slow is active. - trace! `slow (m!"slow message: " ++ toString (slow b)) + trace[slow] (m!"slow message: " ++ toString (slow b)) def run (x : M Unit) : M Unit := withReader diff --git a/tests/lean/run/withReducibleAndInstancesCrash.lean b/tests/lean/run/withReducibleAndInstancesCrash.lean index c427a771ce..738e5bf59a 100644 --- a/tests/lean/run/withReducibleAndInstancesCrash.lean +++ b/tests/lean/run/withReducibleAndInstancesCrash.lean @@ -10,7 +10,7 @@ def tst : MetaM Unit := do let c ← getConstInfo `boo lambdaTelescope c.value! fun xs b => do withReducibleAndInstances do - trace[Meta.debug]! "b: {← reduce b}" + trace[Meta.debug] "b: {← reduce b}" set_option trace.Meta.debug true #eval tst diff --git a/tests/lean/whnfProj.lean b/tests/lean/whnfProj.lean index 24699be17a..27256d9830 100644 --- a/tests/lean/whnfProj.lean +++ b/tests/lean/whnfProj.lean @@ -11,10 +11,10 @@ open Lean.Meta def tst (declName : Name) : MetaM Unit := do let c ← getConstInfo declName lambdaTelescope c.value! fun _ b => do - trace[Meta.debug]! "1. {b}" - trace[Meta.debug]! "2. {← withReducible <| whnf b}" - trace[Meta.debug]! "3. {← withReducibleAndInstances <| whnf b}" - trace[Meta.debug]! "4. {← withDefault <| whnf b}" + trace[Meta.debug] "1. {b}" + trace[Meta.debug] "2. {← withReducible <| whnf b}" + trace[Meta.debug] "3. {← withReducibleAndInstances <| whnf b}" + trace[Meta.debug] "4. {← withDefault <| whnf b}" pure () set_option trace.Meta.debug true diff --git a/tests/playground/deriving.lean b/tests/playground/deriving.lean index 286b3195b7..5fd55065e2 100644 --- a/tests/playground/deriving.lean +++ b/tests/playground/deriving.lean @@ -58,7 +58,7 @@ open Lean.Meta def tst : MetaM Unit := do let info ← getConstInfoInduct `Test.Bla - trace[Meta.debug]! "nested: {info.isNested}" + trace[Meta.debug] "nested: {info.isNested}" pure () #eval tst @@ -128,7 +128,7 @@ def mkContext (className : Name) (typeName : Name) (resultType : Syntax) (mkAltR match className.eraseMacroScopes, typeName.eraseMacroScopes with | Name.str _ c _, Name.str _ t _ => auxFunNames := auxFunNames.push (← mkFreshUserName <| Name.mkSimple <| c.decapitalize ++ t) | _, _ => auxFunNames := auxFunNames.push (← mkFreshUserName `instFn) - trace[Meta.debug]! "{auxFunNames}" + trace[Meta.debug] "{auxFunNames}" let usePartial := indVal.isNested || typeInfos.size > 1 return { classInfo := classInfo @@ -283,7 +283,7 @@ def mkInstanceCmds (ctx : Context) : TermElabM (Array Syntax) := do let type ← `($(mkIdent ctx.classInfo.name) $indType) let val ← `(⟨$(mkIdent auxFunName)⟩) let instCmd ← `(instance $binders:implicitBinder* : $type := $val) - trace[Meta.debug]! "\n{instCmd}" + trace[Meta.debug] "\n{instCmd}" instances := instances.push instCmd return instances @@ -293,7 +293,7 @@ def mkDeriving (className : Name) (typeName : Name) (resultType : Syntax) (mkAlt let cmds ← liftTermElabM none do let ctx ← mkContext className typeName resultType mkAltRhs let block ← mkMutualBlock ctx - trace[Meta.debug]! "\n{block}" + trace[Meta.debug] "\n{block}" return #[block] ++ (← mkInstanceCmds ctx) cmds.forM elabCommand