diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-03-11 11:15:49 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-03-12 09:06:15 +0100 |
commit | a4fb77332cf641b023b46af5533b6007948b766e (patch) | |
tree | 2eae8b38ecab0d65f47ed7fbf41bd55d184078e0 /src/reflect | |
parent | 5d54cf9e375d796c59b1dd488c15f88f4bfb14d6 (diff) | |
download | scala-a4fb77332cf641b023b46af5533b6007948b766e.tar.gz scala-a4fb77332cf641b023b46af5533b6007948b766e.tar.bz2 scala-a4fb77332cf641b023b46af5533b6007948b766e.zip |
SI-7240 fixes language feature lookup
As I discovered today, Definitions.getMember have a fallback clause,
which accounts for the phases which have inner classes flattened.
This fallback uses nme.flattenedName to compute a flattened name, but
unfortunately nme.flattenedName produces a TermName, not a TypeName,
which means that the fallback will commence search in a wrong namespace
with predictable results.
The commit also changes another usage of nme.flattenedName in a type name
context. That one was correctly converting a TermName result to TypeName,
so this is not a bugfix, but just a refactoring for the sake of being
consistent.
Diffstat (limited to 'src/reflect')
-rw-r--r-- | src/reflect/scala/reflect/internal/Definitions.scala | 2 | ||||
-rw-r--r-- | src/reflect/scala/reflect/internal/Symbols.scala | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/internal/Definitions.scala b/src/reflect/scala/reflect/internal/Definitions.scala index 6e4ca76382..e5d9e54a16 100644 --- a/src/reflect/scala/reflect/internal/Definitions.scala +++ b/src/reflect/scala/reflect/internal/Definitions.scala @@ -1046,7 +1046,7 @@ trait Definitions extends api.StandardDefinitions { getMemberIfDefined(owner, name) orElse { if (phase.flatClasses && name.isTypeName && !owner.isPackageObjectOrClass) { val pkg = owner.owner - val flatname = nme.flattenedName(owner.name, name) + val flatname = tpnme.flattenedName(owner.name, name) getMember(pkg, flatname) } else fatalMissingSymbol(owner, name) diff --git a/src/reflect/scala/reflect/internal/Symbols.scala b/src/reflect/scala/reflect/internal/Symbols.scala index d9eb48ff2d..45c16b7302 100644 --- a/src/reflect/scala/reflect/internal/Symbols.scala +++ b/src/reflect/scala/reflect/internal/Symbols.scala @@ -3022,7 +3022,7 @@ trait Symbols extends api.Symbols { self: SymbolTable => if (Statistics.canEnable) Statistics.incCounter(nameCount) if (needsFlatClasses) { if (flatname eq null) - flatname = nme.flattenedName(rawowner.name, rawname).toTypeName + flatname = tpnme.flattenedName(rawowner.name, rawname) flatname } |