Skip to content

Commit 03f6ea5

Browse files
committed
minor
1 parent a492f50 commit 03f6ea5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

commons-core/src/test/scala/com/avsystem/commons/macros/TypeStringTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class TypeStringTest extends FunSuite {
100100
// testTypeString[fu.bar.q.type forSome {val fu: Fuu}]("fu.bar.q.type forSome {val fu: Fuu}")
101101
// testTypeString[AnyRef with Serializable]("AnyRef with Serializable")
102102

103-
UnrelatedTypeString.defineTests(this)
103+
UnrelatedTypeString.defineTests[String](this)
104104
}
105105

106106
object UnrelatedTypeString {

commons-macros/src/main/scala/com/avsystem/commons/macros/misc/MiscMacros.scala

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ class MiscMacros(ctx: blackbox.Context) extends AbstractMacroCommons(ctx) {
143143
}
144144

145145
def mkTypeString(tpe: Type): List[Tree] = tpe match {
146-
case _ if tpe.typeSymbol == definitions.AnyRefClass => List(lit("AnyRef"))
146+
case _ if tpe =:= typeOf[AnyRef] => List(lit("AnyRef"))
147147
case TypeRef(NoPrefix, ExistentialSingleton(_, name, _), Nil) =>
148148
List(lit(mkNameString(name)))
149149
case TypeRef(_, sym, args) if definitions.FunctionClass.seq.contains(sym) =>
@@ -156,8 +156,7 @@ class MiscMacros(ctx: blackbox.Context) extends AbstractMacroCommons(ctx) {
156156
val dealiased = tpe.dealias
157157
if (dealiased.typeSymbol != sym && !isStaticPrefix(pre)) {
158158
mkTypeString(dealiased)
159-
}
160-
else {
159+
} else {
161160
val argsReprs =
162161
if (args.isEmpty) Nil
163162
else lit("[") +: join(args.map(typeStringParts), ", ") :+ lit("]")

0 commit comments

Comments
 (0)