Skip to content

Commit 275115e

Browse files
oderskyAdriaan Moors
authored and
Adriaan Moors
committed
Fixing problem that caused fingerprints to fail in reflection.
Also fixed test case that failed when moving to findMembers. Avoids similar problems in the future by renaming nme.ANYNAME
1 parent e94252e commit 275115e

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/compiler/scala/tools/nsc/typechecker/RefChecks.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ abstract class RefChecks extends InfoTransform with reflect.internal.transform.R
119119
// those with the DEFAULTPARAM flag, and infer the methods. Looking for the methods
120120
// directly requires inspecting the parameter list of every one. That modification
121121
// shaved 95% off the time spent in this method.
122-
val defaultGetters = clazz.info.findMember(nme.ANYNAME, 0L, DEFAULTPARAM, false).alternatives
122+
val defaultGetters = clazz.info.findMembers(0L, DEFAULTPARAM)
123123
val defaultMethodNames = defaultGetters map (sym => nme.defaultGetterToMethod(sym.name))
124124

125125
defaultMethodNames.distinct foreach { name =>

src/reflect/scala/reflect/api/StandardNames.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ trait StandardNames extends base.StandardNames {
4343
val SUPER_PREFIX_STRING: String
4444
val TRAIT_SETTER_SEPARATOR_STRING: String
4545

46-
val ANYNAME: TermName
4746
val FAKE_LOCAL_THIS: TermName
4847
val INITIALIZER: TermName
4948
val LAZY_LOCAL: TermName

src/reflect/scala/reflect/internal/StdNames.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ trait StdNames {
294294
val WHILE_PREFIX = "while$"
295295

296296
// Compiler internal names
297-
val ANYNAME: NameType = "<anyname>"
297+
val ANYname: NameType = "<any>"
298298
val CONSTRUCTOR: NameType = "<init>"
299299
val EQEQ_LOCAL_VAR: NameType = "eqEqTemp$"
300300
val FAKE_LOCAL_THIS: NameType = "this$"

src/reflect/scala/reflect/runtime/SymbolLoaders.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,10 @@ trait SymbolLoaders { self: SymbolTable =>
9999
0 < dp && dp < (name.length - 1)
100100
}
101101

102-
class PackageScope(pkgClass: Symbol) extends Scope() with SynchronizedScope {
102+
class PackageScope(pkgClass: Symbol) extends Scope(initFingerPrints = -1L) // disable fingerprinting as we do not know entries beforehand
103+
with SynchronizedScope {
103104
assert(pkgClass.isType)
105+
// disable fingerprinting as we do not know entries beforehand
104106
private val negatives = mutable.Set[Name]() // Syncnote: Performance only, so need not be protected.
105107
override def lookupEntry(name: Name): ScopeEntry = {
106108
val e = super.lookupEntry(name)

0 commit comments

Comments
 (0)