Skip to content

Issues with default parameters #6769

Closed

Description

@imbrem

Prerequisites

Please put an X between the brackets as you perform the following steps:

Description

Default parameters and default initialization with tactics do not seem to play well together. In particular, the following two test programs do not typecheck:

class Foo where
  x : Nat := by fail

class Bar extends Foo where
  x := 0

instance : Bar where

and

class Foo where
  x : Nat
  hx : x = x

class Bar extends Foo where
  hx' : x = x := by rfl
  hx := hx'

instance : Bar where
  x := 0

On the other hand,

class Foo where
  x : Nat
  hx : x = x

class Bar extends Foo where
  hx' : x = x := rfl
  hx := hx'

instance : Bar where
  x := 0

works as expected, so it's got something to do with tactics.

Context

I'm trying to implement premonoidal categories in mathlib without breaking the old MonoidalCategory API, and this requires a lot of default conditions. Getting everything to work is very challenging!

Versions

Still broken as of 4.16.0-nightly-2025-01-24

Activity

  1. added
    bug
    on Jan 24, 2025
  2. self-assigned this
    on Jan 24, 2025
  3. added
    P-low
    on Jan 28, 2025
  4. added a commit that references this issue on Apr 4, 2025
    11d21af
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P-lowbug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions