We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3ad624f + 7eb3572 commit 7e9ea25Copy full SHA for 7e9ea25
compiler/src/dotty/tools/dotc/core/NameOps.scala
@@ -190,10 +190,13 @@ object NameOps {
190
191
/** Parsed function arity for function with some specific prefix */
192
private def functionArityFor(prefix: String): Int = {
193
- if (name.startsWith(prefix))
194
- try name.toString.substring(prefix.length).toInt
195
- catch { case _: NumberFormatException => -1 }
196
- else -1
+ if (name.startsWith(prefix)) {
+ val suffix = name.toString.substring(prefix.length)
+ if (suffix.matches("\\d+"))
+ suffix.toInt
197
+ else
198
+ -1
199
+ } else -1
200
}
201
202
/** The name of the generic runtime operation corresponding to an array operation */
0 commit comments