Skip to content

Commit

Permalink
restructure-part4: more ScalaDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
aslesarenko committed Mar 3, 2023
1 parent 257ed7f commit 637a7f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/src/main/scala/scalan/util/ReflectionUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,15 @@ import scala.language.existentials
object ReflectionUtil {

implicit class ClassOps(val cl: Class[_]) extends AnyVal {
/** Special character in the name. */
private def isSpecialChar(c: Char): Boolean = {
('0' <= c && c <= '9') || c == '$'
}

/** Safe version of `getSimpleName` that works around a bug in Scala compilers 2.11, 2.12.
* This method is only used for debugging purposes.
* @see https://github.com/scala/bug/issues/5425
*/
def safeSimpleName: String = {
if (cl.getEnclosingClass == null) return cl.getSimpleName
val simpleName = cl.getName.substring(cl.getEnclosingClass.getName.length)
Expand Down

0 comments on commit 637a7f0

Please sign in to comment.