Skip to content

Commit 3045aef

Browse files
committed
chore: fix tests after #6528 disabled autoimplicits (#6597)
These work on the command line and therefore didn't fail in CI (as `lake env lean blah.lean` doesn't pick up the extra lean args?) but as soon as you open one of these files in vscode you get a sea of red errors. I tried to fix a couple in a minimal way, if there was just for example one universe level missing, for most files the "fix" for now is just reenabling autoimplicits for the file. This revealed a couple of tests that were incorrectly using an implicit type when they thought they were using Nat. Two files had issues, that we may want to follow up on `test/superscript.lean` which failed even with autoimplicits turned on when using an autoimplicit superscript variable (unsure if this was intentional). And the `ToExpr` deriving handler seems to rely on autoimplicits somehow to work properly in the presence of universe, if an explicit universe variable is added there is still an error.
1 parent ae892b7 commit 3045aef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+88
-8
lines changed

test/Alias.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ example : True := by
7373
guard_hyp h2 :ₛ 2 = 21 + 1 = 2
7474
trivial
7575

76-
def foo : := id
76+
def foo : NatNat := id
7777

7878
alias foo ← bar
7979

80-
def baz (n : ) := bar n
80+
def baz (n : Nat) := bar n
8181

8282
end Alias

test/CategoryTheory/Elementwise.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import Std.Tactic.GuardExpr
22
import Mathlib.Tactic.CategoryTheory.Elementwise
33
--import Mathlib.Algebra.Category.Mon.Basic
44

5+
set_option autoImplicit true
6+
57
namespace ElementwiseTest
68
open CategoryTheory
79

test/CommDiag.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import ProofWidgets.Component.GoalTypePanel
33

44
/-! ## Example use of commutative diagram widgets -/
55

6+
universe u
67
namespace CategoryTheory
78
open ProofWidgets
89

test/Continuity.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import Mathlib.Topology.Basic
22
import Mathlib.Topology.ContinuousFunction.Basic
33

4+
set_option autoImplicit true
45
section basic
56

67
variable [TopologicalSpace W] [TopologicalSpace X] [TopologicalSpace Y] [TopologicalSpace Z]

test/DeriveFintype.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Mathlib.Tactic.DeriveFintype
22
import Mathlib.Data.Fintype.Prod
33
import Mathlib.Data.Fintype.Pi
44

5+
set_option autoImplicit true
56
namespace tests
67

78
/-

test/DeriveToExpr.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import Mathlib.Tactic.DeriveToExpr
33
namespace tests
44
open Lean
55

6+
-- TODO this file fails without this line due to a bug in the handler?
7+
set_option autoImplicit true
68
set_option trace.Elab.Deriving.toExpr true
79

810
inductive MyMaybe (α : Type u)

test/ExtractGoal.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import Mathlib.Tactic.ExtractGoal
22
import Mathlib.Data.Nat.Basic
33

44
set_option pp.unicode.fun true
5+
set_option autoImplicit true
56

67
-- the example in the documentation for the tactic.
78
/-- info: theorem extracted_1 (i j k : ℕ) (h₀ : i ≤ j) (h₁ : j ≤ k) : i ≤ k := sorry -/

test/FBinop.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Mathlib.Data.Finset.Prod
44
import Mathlib.Data.SetLike.Basic
55

66
universe u v w
7+
set_option autoImplicit true
78

89
namespace FBinopTests
910

test/Find.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import Mathlib.Tactic.Find
22

3-
theorem add_comm_zero : 0 + n = n + 0 := Nat.add_comm _ _
3+
theorem add_comm_zero {n} : 0 + n = n + 0 := Nat.add_comm _ _
44

55
#find _ + _ = _ + _
66
#find ?n + _ = _ + ?n

test/GCongr/mod.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Authors: Heather Macbeth
66
import Mathlib.Data.Int.ModEq
77

88
/-! # Modular arithmetic tests for the `gcongr` tactic -/
9+
set_option autoImplicit true
910

1011
example (ha : a ≡ 2 [ZMOD 4]) : a * b ^ 2 + a ^ 2 * b + 32 * b ^ 2 + 2 ^ 2 * b + 3 [ZMOD 4] := by
1112
gcongr

0 commit comments

Comments
 (0)