Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignoring default value for field warning #2178

Closed
gebner opened this issue Mar 31, 2023 · 1 comment
Closed

Ignoring default value for field warning #2178

gebner opened this issue Mar 31, 2023 · 1 comment
Labels
bug Something isn't working Mathlib4 high prio Mathlib4 high priority issue

Comments

@gebner
Copy link
Member

gebner commented Mar 31, 2023

class Zero (α : Type u) where
  zero : α
class AddZeroClass (M : Type u) extends Zero M, Add M
class AddMonoid (M : Type u) extends AddZeroClass M where
  nsmul : Nat → M → M := fun _ _ => Zero.zero
class AddCommMonoid (M : Type u) extends Zero M, AddMonoid M
class AddMonoidWithOne (R : Type u) extends AddMonoid R
class AddCommMonoidWithOne (R : Type u) extends AddMonoidWithOne R, AddCommMonoid R
class NonAssocSemiring (α : Type u) extends Zero α, AddCommMonoidWithOne α
class Semiring (α : Type u) extends Zero α, NonAssocSemiring α
  -- ignoring default value for field 'nsmul'

The last class declaration unexpectedly produces the above warning, with no apparent way to fix it. Declaring the default value again in Semiring does not help either.

@gebner gebner added the bug Something isn't working label Mar 31, 2023
@gebner
Copy link
Member Author

gebner commented Mar 31, 2023

I think I know where it's going wrong:

#print NonAssocSemiring.nsmul._default
/-
@[reducible] def NonAssocSemiring.nsmul._default.{u_1} : {α : Type u_1} →
  Zero α → Add α → (Nat → α → α) → Nat → α → α :=
fun {α} toZero toAdd nsmul => id fun x x => Zero.zero
-/

@kim-em kim-em added the Mathlib4 high prio Mathlib4 high priority issue label Oct 11, 2023
leodemoura added a commit that referenced this issue Oct 29, 2023
kim-em pushed a commit that referenced this issue Oct 30, 2023
@kim-em kim-em closed this as completed in db281f6 Oct 30, 2023
Komyyy pushed a commit to Komyyy/lean4 that referenced this issue Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Mathlib4 high prio Mathlib4 high priority issue
Projects
None yet
Development

No branches or pull requests

2 participants