Refactoring: Move quoteIfNeeded function to idea-core

This commit is contained in:
Alexey Sedunov
2016-05-24 15:28:27 +03:00
parent 3f4cde3d25
commit a743098aba
7 changed files with 8 additions and 7 deletions
@@ -158,3 +158,5 @@ fun KtCallableDeclaration.canOmitDeclaredType(initializerOrBodyExpression: KtExp
if (KotlinTypeChecker.DEFAULT.equalTypes(expressionType, declaredType)) return true
return canChangeTypeToSubtype && expressionType.isSubtypeOf(declaredType)
}
fun String.quoteIfNeeded(): String = if (KotlinNameSuggester.isIdentifier(this)) this else "`$this`"