leanprover-community / leanprover-community/lean

old_structure_cmd cannot extend structures with subobjects

Open
#285 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
434
Forks
79
PR merge metrics
No merged PRs in 30d

Description

class A : Type :=
(B : true)

class C extends A :=
(D : true)

set_option old_structure_cmd true
class E extends C :=
(F : true)

#print E
/-
@[class]
inductive E : Type
constructors:
E.mk : Π [_to_A : A], true → true → E
-/

def G : E :=
{ B := trivial,
  D := trivial,
  F := trivial }
/-
invalid structure value {...}, expected type is known, but it is not a structure
  E
-/

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reproducer in the issue: define A, C, and E using old_structure_cmd, then inspect the #print E output and the failing structure literal for G. The work is done when E can be initialized with B, D, and F as shown, with coverage for extending a structure that has subobjects.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.