Replace '-' with '_' in Obj-C prefixes (#1985)

This commit is contained in:
Ilya Matveev
2018-08-31 21:50:07 +07:00
committed by Nikolay Igotti
parent dd3ce12e28
commit 7c37f3134f
@@ -436,7 +436,10 @@ private fun ObjCExportMapper.canHaveSameName(first: PropertyDescriptor, second:
internal val ModuleDescriptor.namePrefix: String get() {
// <fooBar> -> FooBar
val moduleName = this.name.asString().let { it.substring(1, it.lastIndex) }.capitalize()
val moduleName = this.name.asString()
.let { it.substring(1, it.lastIndex) }
.capitalize()
.replace('-', '_')
val uppers = moduleName.filterIndexed { index, character -> index == 0 || character.isUpperCase() }
if (uppers.length >= 3) return uppers