diff options
Diffstat (limited to 'src/dotty/tools/dotc/core/NameOps.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/NameOps.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dotty/tools/dotc/core/NameOps.scala b/src/dotty/tools/dotc/core/NameOps.scala index 6d3921ec2..c67bded72 100644 --- a/src/dotty/tools/dotc/core/NameOps.scala +++ b/src/dotty/tools/dotc/core/NameOps.scala @@ -92,8 +92,10 @@ object NameOps { while (pos > 0 && name(pos - 1).isDigit) pos -= 1 - if (pos <= 0 || pos == name.length || name(pos - 1) != '$') name - else name take (pos - 1) + if (pos > 0 && pos < name.length && name(pos - 1) == '$') + name take (pos - 1) + else + name } def stripModuleSuffix: Name = |