diff options
author | Martin Odersky <odersky@gmail.com> | 2016-12-14 22:21:51 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2016-12-14 23:27:05 +0100 |
commit | 9bf58090c704a59d8735874c565200758bcea666 (patch) | |
tree | 705c77dc8cea85ecf0203ea710957542541c4bb5 /compiler/src/dotty/tools/dotc/core/Definitions.scala | |
parent | ba06bf06721f1a8de7d68d22ad7eba27fff90c43 (diff) | |
download | dotty-9bf58090c704a59d8735874c565200758bcea666.tar.gz dotty-9bf58090c704a59d8735874c565200758bcea666.tar.bz2 dotty-9bf58090c704a59d8735874c565200758bcea666.zip |
Change by-name pattern matching.
New implementation following the scheme outlined in #1790.
Diffstat (limited to 'compiler/src/dotty/tools/dotc/core/Definitions.scala')
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/Definitions.scala | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/src/dotty/tools/dotc/core/Definitions.scala b/compiler/src/dotty/tools/dotc/core/Definitions.scala index e4e5761b2..1a7c62b30 100644 --- a/compiler/src/dotty/tools/dotc/core/Definitions.scala +++ b/compiler/src/dotty/tools/dotc/core/Definitions.scala @@ -675,7 +675,9 @@ class Definitions { private def isVarArityClass(cls: Symbol, prefix: Name) = { val name = scalaClassName(cls) - name.startsWith(prefix) && name.drop(prefix.length).forall(_.isDigit) + name.startsWith(prefix) && + name.length > prefix.length && + name.drop(prefix.length).forall(_.isDigit) } def isBottomClass(cls: Symbol) = |