Skip to content

Commit d1d4700

Browse files
committed
Fix wrong parens in compareCapturing test
This fix removed quite a few spurious error notes.
1 parent cf54d1d commit d1d4700

File tree

6 files changed

+2
-26
lines changed

6 files changed

+2
-26
lines changed

compiler/src/dotty/tools/dotc/core/TypeComparer.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2913,8 +2913,8 @@ class TypeComparer(@constructorOnly initctx: Context) extends ConstraintHandling
29132913
errorNotes = (level, CaptureSet.MutAdaptFailure(cs, tp1, tp2)) :: rest
29142914
case _ =>
29152915
subc
2916-
&& (tp1.isBoxedCapturing == tp2.isBoxedCapturing)
2917-
|| refs1.subCaptures(CaptureSet.empty, makeVarState())
2916+
&& (tp1.isBoxedCapturing == tp2.isBoxedCapturing
2917+
|| refs1.subCaptures(CaptureSet.empty, makeVarState()))
29182918

29192919
protected def logUndoAction(action: () => Unit) =
29202920
undoLog += action

tests/neg-custom-args/captures/lazyvals-sep.check

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
|Found: Ref^{TestClass.this.r.rd}
3030
|Required: Ref^
3131
|
32-
|Note that capability TestClass.this.r.rd is not included in capture set {}.
33-
|
3432
|Note that {cap} is an exclusive capture set of the mutable type Ref^,
3533
|it cannot subsume a read-only capture set of the mutable type Ref^{TestClass.this.r.rd}.
3634
|
@@ -43,8 +41,6 @@
4341
|Found: Ref^{TestClass.this.r.rd}
4442
|Required: Ref^
4543
|
46-
|Note that capability TestClass.this.r.rd is not included in capture set {}.
47-
|
4844
|Note that {cap} is an exclusive capture set of the mutable type Ref^,
4945
|it cannot subsume a read-only capture set of the mutable type Ref^{TestClass.this.r.rd}.
5046
|

tests/neg-custom-args/captures/linear-buffer.check

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
| Found: BadBuffer[T]^{BadBuffer.this.rd}
55
| Required: BadBuffer[T]^
66
|
7-
| Note that capability BadBuffer.this.rd is not included in capture set {}.
8-
|
97
| Note that {cap} is an exclusive capture set of the mutable type BadBuffer[T]^,
108
| it cannot subsume a read-only capture set of the mutable type BadBuffer[T]^{BadBuffer.this.rd}.
119
|

tests/neg-custom-args/captures/mutability.check

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
| Found: Ref[T]^{Ref.this.rd}
1515
| Required: Ref[T]^
1616
|
17-
| Note that capability Ref.this.rd is not included in capture set {}.
18-
|
1917
| Note that {cap} is an exclusive capture set of the mutable type Ref[T]^,
2018
| it cannot subsume a read-only capture set of the mutable type Ref[T]^{Ref.this.rd}.
2119
|
@@ -40,8 +38,6 @@
4038
| Found: () ->{Ref.this.rd} Ref[T^'s1]^{Ref.this.rd}
4139
| Required: () => Ref[T]^
4240
|
43-
| Note that capability Ref.this.rd is not included in capture set {}.
44-
|
4541
| Note that {cap} is an exclusive capture set of the mutable type Ref[T]^,
4642
| it cannot subsume a read-only capture set of the mutable type Ref[T^'s1]^{Ref.this.rd}.
4743
|
@@ -67,8 +63,6 @@
6763
| Found: Ref[T]^{Ref.this.rd}
6864
| Required: Ref[T]^
6965
|
70-
| Note that capability Ref.this.rd is not included in capture set {}.
71-
|
7266
| Note that {cap} is an exclusive capture set of the mutable type Ref[T]^,
7367
| it cannot subsume a read-only capture set of the mutable type Ref[T]^{Ref.this.rd}.
7468
|
@@ -103,8 +97,6 @@
10397
| Found: () ->{ref2.rd} Ref2[Int]^{ref2}
10498
| Required: () => Ref2[Int]^
10599
|
106-
| Note that capability ref2 is not included in capture set {}.
107-
|
108100
| Note that {cap} is an exclusive capture set of the mutable type Ref2[Int]^,
109101
| it cannot subsume a read-only capture set of the mutable type Ref2[Int]^{ref2}.
110102
|

tests/neg-custom-args/captures/mutvars.check

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
| Found: Ref[T]^{Ref.this.rd}
1515
| Required: Ref[T]^
1616
|
17-
| Note that capability Ref.this.rd is not included in capture set {}.
18-
|
1917
| Note that {cap} is an exclusive capture set of the mutable type Ref[T]^,
2018
| it cannot subsume a read-only capture set of the mutable type Ref[T]^{Ref.this.rd}.
2119
|
@@ -33,8 +31,6 @@
3331
| Found: () ->{Ref.this.rd} Ref[T^'s1]^{Ref.this.rd}
3432
| Required: () => Ref[T]^
3533
|
36-
| Note that capability Ref.this.rd is not included in capture set {}.
37-
|
3834
| Note that {cap} is an exclusive capture set of the mutable type Ref[T]^,
3935
| it cannot subsume a read-only capture set of the mutable type Ref[T^'s1]^{Ref.this.rd}.
4036
|
@@ -53,8 +49,6 @@
5349
| Found: Ref[T]^{Ref.this.rd}
5450
| Required: Ref[T]^
5551
|
56-
| Note that capability Ref.this.rd is not included in capture set {}.
57-
|
5852
| Note that {cap} is an exclusive capture set of the mutable type Ref[T]^,
5953
| it cannot subsume a read-only capture set of the mutable type Ref[T]^{Ref.this.rd}.
6054
|
@@ -82,8 +76,6 @@
8276
| Found: () ->{ref2.rd} Ref2[Int]^{ref2}
8377
| Required: () => Ref2[Int]^
8478
|
85-
| Note that capability ref2 is not included in capture set {}.
86-
|
8779
| Note that {cap} is an exclusive capture set of the mutable type Ref2[Int]^,
8880
| it cannot subsume a read-only capture set of the mutable type Ref2[Int]^{ref2}.
8981
|

tests/neg-custom-args/captures/ro-mut-conformance.check

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
| Found: (a : Ref)
1010
| Required: Ref^
1111
|
12-
| Note that capability a is not included in capture set {}.
13-
|
1412
| Note that {cap} is an exclusive capture set of the mutable type Ref^,
1513
| it cannot subsume a read-only capture set of the mutable type (a : Ref).
1614
|

0 commit comments

Comments
 (0)