Skip to content

Commit 1cf238f

Browse files
committed
Drop redundant copying logic
1 parent 0dd57f2 commit 1cf238f

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

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

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -708,19 +708,6 @@ class CheckCaptures extends Recheck, SymTransformer:
708708
selType
709709
}//.showing(i"recheck sel $tree, $qualType = $result")
710710

711-
/** Hook for massaging a function before it is applied. Copies all @use and @consume
712-
* annotations on method parameter symbols to the corresponding paramInfo types.
713-
*/
714-
override def prepareFunction(funtpe: MethodType, meth: Symbol)(using Context): MethodType =
715-
val paramInfosWithUses =
716-
funtpe.paramInfos.zipWithConserve(funtpe.paramNames): (formal, pname) =>
717-
val param = meth.paramNamed(pname)
718-
def copyAnnot(tp: Type, cls: ClassSymbol) = param.getAnnotation(cls) match
719-
case Some(ann) if !tp.hasAnnotation(cls) => AnnotatedType(tp, ann)
720-
case _ => tp
721-
copyAnnot(copyAnnot(formal, defn.UseAnnot), defn.ConsumeAnnot)
722-
funtpe.derivedLambdaType(paramInfos = paramInfosWithUses)
723-
724711
/** Recheck applications, with special handling of unsafeAssumePure.
725712
* More work is done in `recheckApplication`, `recheckArg` and `instantiate` below.
726713
*/

0 commit comments

Comments
 (0)