Skip to content

Commit 8e86060

Browse files
committed
chore: remove unused variables warning showing up in build
Opted to fix the warnings instead of silencing them, except for the case involving a mutual inductive. I'm surprised by the behavior of the linter there, disabled warning for now.
1 parent e39d5bd commit 8e86060

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

test-projects/tutorial-test/TutorialExample/Data.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@ mutual
341341
| succ : Even n → Odd (n + 1)
342342
end
343343

344+
set_option linter.unusedVariables false
345+
344346
-- Trees with different node types
345347
mutual
346348
inductive TreeA (α : Type) where

test-projects/tutorial-test/TutorialExample/RCases.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -487,8 +487,8 @@ example (h : ∃ n, P n) : True := by
487487
trivial
488488

489489
-- Or just:
490-
example (h : ∃ n, P n) : True := by
491-
trivial -- h not needed at all
490+
example (_ : ∃ n, P n) : True := by
491+
trivial -- hypothesis not needed at all
492492
end
493493
```
494494

test-projects/website/DemoSite/Blog/Conditionals.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Here's an inductive type and a structure:
153153
```lean demo
154154
inductive A where
155155
| a1 | a2
156-
| a3 (n : Nat)
156+
| a3 : Nat → A
157157
| a4 : (n : Nat) → n = 3 → A
158158

159159
structure S where
@@ -190,7 +190,7 @@ def quoted (str : String) : m Syntax := do
190190
let s ← `(a b c #[x, $(quote str), z])
191191
pure s
192192

193-
example : ¬(quoted (m := m) = fun x => pure .missing) := by
193+
example : ¬(quoted (m := m) = fun _ => pure .missing) := by
194194
unfold quoted
195195
intro h
196196
let g : String → m Syntax := fun str => do

0 commit comments

Comments
 (0)