Skip to content

Commit d71358f

Browse files
committed
Don't include use sets of class constructors in use sets of enclosing classes
1 parent 182a26a commit d71358f

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/cc/CheckCaptures.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -865,7 +865,7 @@ class CheckCaptures extends Recheck, SymTransformer:
865865
val (refined, cs) = addParamArgRefinements(core, initCs)
866866
refined.capturing(cs)
867867

868-
augmentConstructorType(resType, capturedVars(cls) ++ capturedVars(constr))
868+
augmentConstructorType(resType, capturedVars(cls))
869869
.showing(i"constr type $mt with $argTypes%, % in $constr = $result", capt)
870870
end refineConstructorInstance
871871

tests/neg-custom-args/captures/real-try.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
-- Error: tests/neg-custom-args/captures/real-try.scala:32:10 ----------------------------------------------------------
4444
32 | val b = try // error
4545
| ^
46-
| The result of `try` cannot have type Cell[() => Unit]^'s2 since
46+
| The result of `try` cannot have type Cell[() => Unit] since
4747
| the part () => Unit of that type captures the root capability `cap`.
4848
| This is often caused by a locally generated exception capability leaking as part of its result.
4949
|

tests/neg-custom-args/captures/unsound-reach-4.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/unsound-reach-4.scala:20:29 ------------------------------
99
20 | val backdoor: Foo[File^] = new Bar // error (follow-on, since the parent Foo[File^] of bar is illegal).
1010
| ^^^^^^^
11-
| Found: Bar^'s1
11+
| Found: Bar
1212
| Required: Foo[File^]
1313
|
1414
| Note that capability cap is not included in capture set {cap²}

tests/neg-custom-args/captures/unsound-reach.check

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
-- [E007] Type Mismatch Error: tests/neg-custom-args/captures/unsound-reach.scala:18:31 --------------------------------
1616
18 | val backdoor: Foo[File^] = new Bar // error (follow-on, since the parent Foo[File^] of bar is illegal).
1717
| ^^^^^^^
18-
| Found: Bar^'s1
18+
| Found: Bar
1919
| Required: Foo[File^]
2020
|
2121
| Note that capability cap is not included in capture set {cap²}

0 commit comments

Comments
 (0)