fix: derive Repr missing a comma
This commit is contained in:
parent
9fdcfebb97
commit
96b49261e6
3 changed files with 21 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ def mkBodyForStruct (header : Header) (indVal : InductiveVal) : TermElabM Term :
|
|||
let fieldName := fieldNames[i]!
|
||||
let fieldNameLit := Syntax.mkStrLit (toString fieldName)
|
||||
let x := xs[numParams + i]!
|
||||
if i > numParams then
|
||||
if i != 0 then
|
||||
fields ← `($fields ++ "," ++ Format.line)
|
||||
if (← isType x <||> isProof x) then
|
||||
fields ← `($fields ++ $fieldNameLit ++ " := " ++ "_")
|
||||
|
|
|
|||
18
tests/lean/1668.lean
Normal file
18
tests/lean/1668.lean
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
structure Point where
|
||||
x : Nat
|
||||
y : Nat
|
||||
deriving Repr
|
||||
|
||||
structure PPoint (α : Type) where
|
||||
x : α
|
||||
y : α
|
||||
deriving Repr
|
||||
|
||||
def origin : Point :=
|
||||
{ x := Nat.zero, y := Nat.zero }
|
||||
|
||||
def natOrigin : PPoint Nat :=
|
||||
{ x := Nat.zero, y := Nat.zero }
|
||||
|
||||
#eval origin
|
||||
#eval natOrigin
|
||||
2
tests/lean/1668.lean.expected.out
Normal file
2
tests/lean/1668.lean.expected.out
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
{ x := 0, y := 0 }
|
||||
{ x := 0, y := 0 }
|
||||
Loading…
Add table
Reference in a new issue