Skip to content

Commit

Permalink
Mark macro-type-change-3 as passing
Browse files Browse the repository at this point in the history
The reason the test failed was not because of issue with transitive external invalidation, but rather the macro itself is the issue.
  • Loading branch information
Friendseeker committed Dec 29, 2023
1 parent d23bc27 commit a9846ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions zinc/src/sbt-test/macros/macro-type-change-3/macros/Macros.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ object Macros {
def hasAnyFieldImpl[T: c.WeakTypeTag](c: Context): c.Expr[Boolean] = {
import c.universe._

val hasField = weakTypeOf[T].members.exists {
case m: TermSymbol => m.isVal || m.isVar
case _ => false
}
val hasField = weakTypeOf[T].baseClasses.flatMap(base =>
base.asType.toType.decls.collect {
case m: TermSymbol if m.isVal || m.isVar => m
}
).nonEmpty

c.Expr[Boolean](Literal(Constant(hasField)))
}
}
}

0 comments on commit a9846ba

Please sign in to comment.