Skip to content

Commit 2b85e29

Browse files
authored
test: version clash w/ diamond deps (#11155)
This PR adds a test replicating Kim's diamond dependency example. The top-level package, `D`, depends on two intermediate packages, `B` and `C`, which each require semantically different versions of another package, `A`. The portion of `A` that `B` and `C` publicly use is unchanged across the versions, but they both privately make use of changed API. Currently, this causes a version clash. This will be made to work without error later this quarter.
1 parent ceb86b1 commit 2b85e29

File tree

19 files changed

+191
-0
lines changed

19 files changed

+191
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.lake
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import DiamondExampleA.Ring.Defs
2+
import DiamondExampleA.Ring.Lemmas
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module
2+
3+
public class Ring (A : Type) extends Add A, Mul A, Neg A, Zero A, One A where
4+
add_assoc : ∀ a b c : A, a + b + c = a + (b + c)
5+
add_comm : ∀ a b : A, a + b = b + a
6+
add_zero : ∀ a : A, a + 0 = a
7+
add_neg : ∀ a : A, a + -a = 0
8+
mul_assoc : ∀ a b c : A, a * b * c = a * (b * c)
9+
mul_comm : ∀ a b : A, a * b = b * a
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module
2+
3+
public import DiamondExampleA.Ring.Defs
4+
5+
namespace Ring
6+
7+
public theorem add_left_comm [Ring α] : ∀ a b c : α, a + (b + c) = b + (a + c) := by
8+
intros a b c
9+
rw [← add_assoc a b c]
10+
rw [add_comm a b]
11+
rw [add_assoc b a c]
12+
13+
end Ring
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name = "DiamondExample-A"
2+
defaultTargets = ["DiamondExampleA"]
3+
4+
[[lean_lib]]
5+
name = "DiamondExampleA"
6+
leanOptions.experimental.module = true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.lake
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import DiamondExampleB.MainResult
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module
2+
3+
public import DiamondExampleA.Ring.Defs
4+
import DiamondExampleA.Ring.Lemmas
5+
6+
open Ring
7+
8+
public theorem foo [Ring α] (a b c d : α) : a + (b + (c + d)) = b + c + a + d := by
9+
rw [poorly_named_lemma]
10+
rw [poorly_named_lemma a c d]
11+
rw [← add_assoc, ← add_assoc]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name = "DiamondExample-B"
2+
defaultTargets = ["DiamondExampleB"]
3+
4+
[[require]]
5+
name = "DiamondExample-A"
6+
git = "../DiamondExample-A"
7+
rev = "v1"
8+
9+
[[lean_lib]]
10+
name = "DiamondExampleB"
11+
leanOptions.experimental.module = true
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.lake

0 commit comments

Comments
 (0)