Skip to content

Commit c20b22c

Browse files
committed
Fix bug where generated classes have dots in the name
1 parent ebf995a commit c20b22c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

processor-kotlin/src/main/kotlin/testaccessors/internal/AccessorWriter.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ internal class AccessorWriter(
3737
val location = extractLocation(enclosingClassElement.enclosingElement) +
3838
enclosingClassElement.simpleName.toString()
3939
val fileAndObjectName = nameForGeneratedClassFrom(
40-
ClassName(location[0], location[1], *location.sliceArray(2..location.lastIndex)).simpleNames)
40+
ClassName(location[0], location[1], *location.sliceArray(2..location.lastIndex)).simpleNames).let {
41+
it.substringAfterLast('.', it)
42+
}
4143
val fileSpecBuilder = FileSpec.builder(
4244
elementUtils.getPackageOf(enclosingClassElement).qualifiedName.toString(), fileAndObjectName)
4345
.indent(" ")

0 commit comments

Comments
 (0)