From 6d39fb49fd6d2a3b16289f5917f9f048fb7f8655 Mon Sep 17 00:00:00 2001 From: Martijn Date: Fri, 7 Jun 2024 20:54:37 +0200 Subject: [PATCH] simply getting target --- shared/src/main/scala-3/org/scalamock/clazz/MockMaker.scala | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/shared/src/main/scala-3/org/scalamock/clazz/MockMaker.scala b/shared/src/main/scala-3/org/scalamock/clazz/MockMaker.scala index 53354cea..76930da7 100644 --- a/shared/src/main/scala-3/org/scalamock/clazz/MockMaker.scala +++ b/shared/src/main/scala-3/org/scalamock/clazz/MockMaker.scala @@ -56,11 +56,7 @@ private[clazz] object MockMaker: tree.tpe.dealias.typeSymbol.primaryConstructor.paramSymss .filterNot(_.exists(_.isType)) .map(_.map{ sym => - val classParamRef = tpe.widen match { - case AppliedType(_, params) => paramsMap.get(sym.info.typeSymbol) - case _ => None - } - val target = classParamRef.getOrElse(sym.info).widen.dealias + val target = paramsMap.getOrElse(sym.info.typeSymbol, sym.info).widen.dealias if target <:< TypeRepr.of[AnyVal] then Select.unique('{null}.asTerm, "asInstanceOf").appliedToType(target) else