File tree 1 file changed +2
-10
lines changed
compiler/src/dotty/tools/dotc/cc
1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -242,18 +242,10 @@ object Existential:
242
242
case _ =>
243
243
core
244
244
245
- /** Map top-level existentials to `cap`. Do the same for existentials
246
- * in function results if all preceding arguments are known to be always pure.
247
- */
245
+ /** Map top-level existentials to `cap`. */
248
246
def toCap (tp : Type )(using Context ): Type = tp.dealiasKeepAnnots match
249
247
case Existential (boundVar, unpacked) =>
250
- val transformed = unpacked.substParam(boundVar, defn.captureRoot.termRef)
251
- transformed match
252
- case FunctionOrMethod (args, res @ Existential (_, _))
253
- if args.forall(_.isAlwaysPure) =>
254
- transformed.derivedFunctionOrMethod(args, toCap(res))
255
- case _ =>
256
- transformed
248
+ unpacked.substParam(boundVar, defn.captureRoot.termRef)
257
249
case tp1 @ CapturingType (parent, refs) =>
258
250
tp1.derivedCapturingType(toCap(parent), refs)
259
251
case tp1 @ AnnotatedType (parent, ann) =>
You can’t perform that action at this time.
0 commit comments