diff options
author | Martin Odersky <odersky@gmail.com> | 2014-11-01 18:32:09 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-11-09 19:08:58 +0100 |
commit | 0119ffd3e285e43b63fb9c43c1c8b009174a1987 (patch) | |
tree | 3e4ef07f32529f68fb86451e31758c5060d3fb7c /src/dotty/tools/dotc/core/NameOps.scala | |
parent | 7c5a3ff5c5d5bc8844d981f55c3e2152976a42ac (diff) | |
download | dotty-0119ffd3e285e43b63fb9c43c1c8b009174a1987.tar.gz dotty-0119ffd3e285e43b63fb9c43c1c8b009174a1987.tar.bz2 dotty-0119ffd3e285e43b63fb9c43c1c8b009174a1987.zip |
Avoid getting confused because of Scala2 local suffixes
When inheriting from Scala2 traits we sometimes encounter names with a space at the end,
denoting a local variable. Drop the space because our translation scheme has no room for it.
Diffstat (limited to 'src/dotty/tools/dotc/core/NameOps.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/NameOps.scala | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/dotty/tools/dotc/core/NameOps.scala b/src/dotty/tools/dotc/core/NameOps.scala index 56f292b87..299ead580 100644 --- a/src/dotty/tools/dotc/core/NameOps.scala +++ b/src/dotty/tools/dotc/core/NameOps.scala @@ -276,6 +276,9 @@ object NameOps { -1 } + def stripScala2LocalSuffix: TermName = + if (name.endsWith(" ")) name.init.asTermName else name + /** The name of an accessor for protected symbols. */ def protectedAccessorName: TermName = PROTECTED_PREFIX ++ name.unexpandedName() |