Skip to content

Commit 4f9068d

Browse files
committed
Fix regression introduced in Return older implementations without FatalError
1 parent dbba7d2 commit 4f9068d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

distage/distage-core-api/src/main/scala/izumi/distage/model/reflection/universe/WithDISymbolInfo.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ trait WithDISymbolInfo { this: DIUniverseBase with WithDISafeType =>
8585
SymbolInfo.Static(
8686
name = transformName(tpe.typeSymbol.name.toString),
8787
finalResultType = tpe,
88-
annotations = AnnotationTools.getAllTypeAnnotations[u.type](tpe),
88+
annotations = AnnotationTools.getAllTypeAnnotations(u)(tpe),
8989
isByName = tpe.typeSymbol.isClass && tpe.typeSymbol.asClass == u.definitions.ByNameParamClass,
9090
wasGeneric = tpe.typeSymbol.isParameter,
9191
)

fundamentals/fundamentals-reflection/src/main/scala/izumi/fundamentals/reflection/AnnotationTools.scala

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
11
package izumi.fundamentals.reflection
22

3+
import izumi.fundamentals.reflection.ReflectionUtil.stripByName
4+
5+
import scala.annotation.nowarn
36
import scala.reflect.api.Universe
47

58
object AnnotationTools {
69

710
def getAllAnnotations(u: Universe)(symb: u.Symbol): List[u.Annotation] = {
8-
symb.annotations ++ getAllTypeAnnotations[u.type](symb.typeSignature)
11+
symb.annotations ++ getAllTypeAnnotations(u)(symb.typeSignature)
912
}
1013

11-
def getAllTypeAnnotations[U <: Universe with Singleton](typ: U#Type): List[U#Annotation] = {
12-
typ.finalResultType.dealias match {
13-
case t: U#AnnotatedTypeApi =>
14+
def getAllTypeAnnotations(u: Universe)(typ: u.Type): List[u.Annotation] = {
15+
@nowarn("msg=outer reference")
16+
val out = stripByName(u)(typ.finalResultType.dealias) match {
17+
case t: u.AnnotatedTypeApi =>
1418
t.annotations
1519
case _ =>
1620
Nil
1721
}
22+
out
1823
}
1924

2025
def annotationTypeEq(u: Universe)(tpe: u.Type, ann: u.Annotation): Boolean = {

0 commit comments

Comments
 (0)