diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-24 13:20:01 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-04-11 09:33:10 +0200 |
commit | 0ad1cd816bc1537ad332addabb0ff6c293e3e0a0 (patch) | |
tree | 68ab44576e17d19fa6cca14a0f750266a638eb7f /compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala | |
parent | a2731a8be2f3434218623c0b0ecd4078107f14a5 (diff) | |
download | dotty-0ad1cd816bc1537ad332addabb0ff6c293e3e0a0.tar.gz dotty-0ad1cd816bc1537ad332addabb0ff6c293e3e0a0.tar.bz2 dotty-0ad1cd816bc1537ad332addabb0ff6c293e3e0a0.zip |
Add default getter names
Plus various bug fixes and filling in missing functionality
Diffstat (limited to 'compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala b/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala index 3a301167d..b6c28f570 100644 --- a/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala +++ b/compiler/src/dotty/tools/dotc/transform/ResolveSuper.scala @@ -18,6 +18,7 @@ import util.Positions._ import Names._ import collection.mutable import ResolveSuper._ +import config.Config /** This phase adds super accessors and method overrides where * linearization differs from Java's rule for default methods in interfaces. @@ -95,10 +96,12 @@ object ResolveSuper { var bcs = base.info.baseClasses.dropWhile(acc.owner != _).tail var sym: Symbol = NoSymbol val unexpandedAccName = - if (acc.is(ExpandedName)) // Cannot use unexpandedName because of #765. t2183.scala would fail if we did. - acc.name - .drop(acc.name.indexOfSlice(nme.EXPAND_SEPARATOR ++ nme.SUPER_PREFIX)) - .drop(nme.EXPAND_SEPARATOR.length) + if (acc.is(ExpandedName)) + if (Config.semanticNames) acc.name.unexpandedName + else // Cannot use unexpandedName because of #765. t2183.scala would fail if we did. + acc.name + .drop(acc.name.indexOfSlice(nme.EXPAND_SEPARATOR ++ nme.SUPER_PREFIX)) + .drop(nme.EXPAND_SEPARATOR.length) else acc.name val SuperAccessorName(memberName) = unexpandedAccName: Name // dotty deviation: ": Name" needed otherwise pattern type is neither a subtype nor a supertype of selector type ctx.debuglog(i"starting rebindsuper from $base of ${acc.showLocated}: ${acc.info} in $bcs, name = $memberName") |