Skip to content

Commit

Permalink
simply getting target
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnhoekstra committed Jun 7, 2024
1 parent c7b23a6 commit 6d39fb4
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions shared/src/main/scala-3/org/scalamock/clazz/MockMaker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6d39fb4

Please sign in to comment.