Skip to content

Commit

Permalink
filter out deprecated methods from Discover macro (have to check this)
Browse files Browse the repository at this point in the history
  • Loading branch information
bishabosha committed Aug 22, 2024
1 parent 7b15ffb commit 296e241
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion main/define/src/mill/define/Discover.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ object Discover {
val crossSym = Symbol.requiredClass("mill.define.Cross")
val crossArg = crossSym.typeMembers.filter(_.isTypeParam).head
val moduleSym = Symbol.requiredClass("mill.define.Module")
val deprecatedSym = Symbol.requiredClass("scala.deprecated")
def rec(tpe: TypeRepr): Unit = {
if (seen.add(tpe)) {
val typeSym = tpe.typeSymbol
Expand Down Expand Up @@ -123,7 +124,7 @@ object Discover {
val mapping = for {
discoveredModuleType <- seen.toSeq.sortBy(_.typeSymbol.fullName)
curCls = discoveredModuleType
methods = curCls.typeSymbol.methodMembers.filterNot(m => m.isSuperAccessor || m.flags.is(Flags.Synthetic | Flags.Invisible | Flags.Private | Flags.Protected)) // getValsOrMeths(curCls) replaced by equivalent from Scala 3 mainargs
methods = curCls.typeSymbol.methodMembers.filterNot(m => m.isSuperAccessor || m.hasAnnotation(deprecatedSym) || m.flags.is(Flags.Synthetic | Flags.Invisible | Flags.Private | Flags.Protected)) // getValsOrMeths(curCls) replaced by equivalent from Scala 3 mainargs
overridesRoutes = {
assertParamListCounts(
curCls,
Expand Down

0 comments on commit 296e241

Please sign in to comment.