Zac Sweers
08/24/2020, 1:11 AMKSName
API as well, then it would be easy for us to write something like fun KSName.toClassName(): ClassName
in KotlinPoet or similarJiaxiang
08/24/2020, 6:05 AMJiaxiang
08/24/2020, 6:07 AMZac Sweers
08/24/2020, 2:40 PMJiaxiang
08/24/2020, 7:43 PMZac Sweers
08/25/2020, 12:08 AMZac Sweers
08/25/2020, 12:09 AMJiaxiang
08/25/2020, 10:11 PMudalov
package/Outer.Inner
format in the Kotlin metadata (and subsequently exposed in the kotlinx-metadata library) specifically because it’s a single string which uniquely identifies a class and all its containing classes and package. I don’t know whether it’s justified to have the same format for names in KSP, but it has nothing to do with JVM, the same is also true for metadata on JS and Native. We could have chosen any other set of delimiter characters, these just seemed the most obvious. In fact, names in the JVM bytecode are mostly package/Outer$Inner
which is not unique enough because classes are allowed to have $
in the names.Zac Sweers
09/01/2020, 9:25 PM$
isn’t reliable enoughJiaxiang
09/12/2020, 12:08 AM