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

symtab initialization doesn't work with --auto-classpath #921

Closed
NicolasRouquette opened this issue Dec 14, 2018 · 1 comment
Closed

symtab initialization doesn't work with --auto-classpath #921

NicolasRouquette opened this issue Dec 14, 2018 · 1 comment

Comments

@NicolasRouquette
Copy link
Contributor

I noticed a subtle problem in the argument validation logic,
At this time, I'm referring to this version: https://github.com/scalacenter/scalafix/blob/8bcc7d440b21bf05eda5cec37edcbe144c073701/scalafix-cli/src/main/scala/scalafix/internal/v1/Args.scala

Specifically, to the difference between:

  def configuredSymtab: Configured[SymbolTable] = {
    Try(
      ClasspathOps.newSymbolTable(
        classpath = classpath,
        out = out
      )
    ) match { ... }
  • The logic of classLoader, which uses the "validated" classpath:
  def classLoader: ClassLoader =
    ClasspathOps.toOrphanClassLoader(validatedClasspath)

This means that when we use scalafix with --auto-classpath and [--auto-classpath-roots <dir>]* arguments, then the symbol table is effectively initialized with an empty classpath.

NicolasRouquette added a commit to NicolasRouquette/scalafix that referenced this issue Dec 15, 2018
olafurpg added a commit that referenced this issue Jan 30, 2019
Failed test demonstrates the problem of #921
@olafurpg
Copy link
Contributor

Fixed in #922

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

2 participants