Skip to content

Ignoring default value for field warning #2178

Closed

Description

@gebner
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.

Activity

  1. added
    bug
    on Mar 31, 2023
  2. gebner commented on Mar 31, 2023

    @gebner
    MemberAuthor

    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
    -/
  3. added
    Mathlib4 high prio
    on Oct 11, 2023
  4. added a commit that references this issue on Oct 29, 2023
    dcf20da
  5. added a commit that references this issue on Oct 30, 2023
    0bb60c7
  6. added a commit that references this issue on Nov 2, 2023
    06531df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Mathlib4 high priobug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions