Skip to content

Commit

Permalink
Improve the deprecated error message such that it matches the one in …
Browse files Browse the repository at this point in the history
…the Obj-C header.
  • Loading branch information
FilipDolnik committed Nov 23, 2023
1 parent 3891715 commit 6771d07
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion SKIE/acceptance-tests
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,9 @@ object AddAvailabilityBasedDeprecationLevelPhase : SirPhase {
}

private fun SirCallableDeclaration.addAvailableAttribute(type: String, message: String?) {
val messagePrefix = "Deprecated in Kotlin"
val messageParameter = if (message != null) ", message: ${message.quoteAsSwiftLiteral()}" else ""

val fullMessage = if (message != null) "$messagePrefix: $message" else messagePrefix

this.attributes.add("available(*, $type, message: ${fullMessage.quoteAsSwiftLiteral()})")
this.attributes.add("available(*, $type$messageParameter)")
}

private fun SirCallableDeclaration.replaceBodyWithError() {
Expand Down

0 comments on commit 6771d07

Please sign in to comment.