diff options
author | Martin Odersky <odersky@gmail.com> | 2015-08-21 15:08:47 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2015-08-21 15:08:47 +0200 |
commit | aaae0df80376668d1c502857695b43d42083c888 (patch) | |
tree | 83aba7b1a390563c26b79a7f5cbfdc4b47a8a66b /src/dotty/tools/dotc/core/NameOps.scala | |
parent | cc5dce545e1150021bcd3d312574bdf3b657512c (diff) | |
download | dotty-aaae0df80376668d1c502857695b43d42083c888.tar.gz dotty-aaae0df80376668d1c502857695b43d42083c888.tar.bz2 dotty-aaae0df80376668d1c502857695b43d42083c888.zip |
Workaround for #765
Avoid using unexpanded name because it can give wrong results for super accessors
of symbolic names. See #765. Without this commit t2183.scala crashes the compiler.
Diffstat (limited to 'src/dotty/tools/dotc/core/NameOps.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/NameOps.scala | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/NameOps.scala b/src/dotty/tools/dotc/core/NameOps.scala index 593d5f036..cab47025e 100644 --- a/src/dotty/tools/dotc/core/NameOps.scala +++ b/src/dotty/tools/dotc/core/NameOps.scala @@ -167,6 +167,11 @@ object NameOps { def expandedName(prefix: Name): N = expandedName(prefix, nme.EXPAND_SEPARATOR) + /** Revert the expanded name. Note: This currently gives incorrect results + * if the normal name contains `nme.EXPAND_SEPARATOR`, i.e. two consecutive '$' + * signs. This can happen for instance if a super accessor is paired with + * an encoded name, e.g. super$$plus$eq. See #765. + */ def unexpandedName: N = { val idx = name.lastIndexOfSlice(nme.EXPAND_SEPARATOR) if (idx < 0) name else (name drop (idx + nme.EXPAND_SEPARATOR.length)).asInstanceOf[N] |