File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
compiler/src/dotty/tools/dotc/cc Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -242,18 +242,10 @@ object Existential:
242242 case _ =>
243243 core
244244
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`. */
248246 def toCap (tp : Type )(using Context ): Type = tp.dealiasKeepAnnots match
249247 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)
257249 case tp1 @ CapturingType (parent, refs) =>
258250 tp1.derivedCapturingType(toCap(parent), refs)
259251 case tp1 @ AnnotatedType (parent, ann) =>
You can’t perform that action at this time.
0 commit comments