Skip to content

Commit 8db5a46

Browse files
committed
Drop followResult = true in CaptureSet.ofInfo
1 parent d966bcc commit 8db5a46

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1303,9 +1303,15 @@ object CaptureSet:
13031303
ref1.captureSetOfInfo.map(ReadOnlyMap())
13041304
case _ =>
13051305
if ref.isMaxCapability then ref.singletonCaptureSet
1306-
else ofType(ref.underlying, followResult = true) // TODO: why followResult = true?
1307-
1308-
/** Capture set of a type */
1306+
else ofType(ref.underlying, followResult = false)
1307+
1308+
/** Capture set of a type
1309+
* @param followResult If true, also include capture sets of function results.
1310+
* This mode is currently not used. It could be interesting
1311+
* when we change the system so that the capture set of a function
1312+
* is the union of the capture sets if its span.
1313+
* In this case we should use `followResult = true` in the call in ofInfo above.
1314+
*/
13091315
def ofType(tp: Type, followResult: Boolean)(using Context): CaptureSet =
13101316
def recur(tp: Type): CaptureSet = trace(i"ofType $tp, ${tp.getClass} $followResult", show = true):
13111317
tp.dealiasKeepAnnots match

0 commit comments

Comments
 (0)