Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SI-8907 Don't force symbol info in isModuleNotMethod
Test case by Jason. RefChecks adds the lateMETHOD flag lazily in its info transformer. This means that forcing the `sym.info` may change the value of `sym.isMethod`. 0ccdb15 introduced a check to force the info in isModuleNotMethod, but it turns out this leads to errors on stub symbols (SI-8907). The responsibility to force info is transferred to callers, which is the case for other operations on symbols, too.
- Loading branch information
Showing
3 changed files
with
66 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import scala.tools.partest._ | ||
import java.io.File | ||
|
||
object Test extends StoreReporterDirectTest { | ||
def code = ??? | ||
|
||
def compileCode(code: String) = { | ||
val classpath = List(sys.props("partest.lib"), testOutput.path) mkString sys.props("path.separator") | ||
compileString(newCompiler("-cp", classpath, "-d", testOutput.path))(code) | ||
} | ||
|
||
def show(): Unit = { | ||
compileCode(""" | ||
class C { class Inner } | ||
class D { | ||
object O { | ||
def foo(c: C)(i: c.Inner): c.Inner = ??? | ||
} | ||
} | ||
""") | ||
assert(filteredInfos.isEmpty, filteredInfos) | ||
deleteClass("C") | ||
compileCode(""" | ||
class E { | ||
def foo = { | ||
(null: D).toString | ||
} | ||
} | ||
""") | ||
assert(storeReporter.infos.isEmpty, storeReporter.infos.mkString("\n")) // Included a MissingRequirementError before. | ||
} | ||
|
||
def deleteClass(name: String) { | ||
val classFile = new File(testOutput.path, name + ".class") | ||
assert(classFile.exists) | ||
assert(classFile.delete()) | ||
} | ||
} |