Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macros#calculateUndetparams is a no-op if there are no undetparams #86

Open
hrhino opened this issue Aug 14, 2019 · 0 comments
Open

Macros#calculateUndetparams is a no-op if there are no undetparams #86

hrhino opened this issue Aug 14, 2019 · 0 comments
Assignees

Comments

@hrhino
Copy link
Collaborator

hrhino commented Aug 14, 2019

https://github.com/scala/scala/blob/546a57105e33678d9d0aba9da486006e4715924c/src/compiler/scala/tools/nsc/typechecker/Macros.scala#L848-859

  private def calculateUndetparams(expandee: Tree): scala.collection.mutable.Set[Symbol] =
    if (forced(expandee)) scala.collection.mutable.Set[Symbol]()
    else delayed.getOrElse(expandee, {
      val calculated = scala.collection.mutable.Set[Symbol]()
      expandee foreach (sub => {
        def traverse(sym: Symbol) = if (sym != null && (undetparams contains sym)) calculated += sym
        if (sub.symbol != null) traverse(sub.symbol)
        if (sub.tpe != null) sub.tpe foreach (sub => traverse(sub.typeSymbol))
      })
      macroLogVerbose("calculateUndetparams: %s".format(calculated))
      calculated
    })
@hrhino hrhino self-assigned this Aug 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant