Minor. Do not check suffix of function for tail-call optimization hit
This commit is contained in:
+1
-1
@@ -34,6 +34,6 @@ fun box(): String {
|
|||||||
val channel: Channel<String> = AbstractChannel<String>()
|
val channel: Channel<String> = AbstractChannel<String>()
|
||||||
res = channel.receiveOrClosed().holder as String
|
res = channel.receiveOrClosed().holder as String
|
||||||
}
|
}
|
||||||
TailCallOptimizationChecker.checkStateMachineIn("receiveOrClosed-v5DwqjU")
|
TailCallOptimizationChecker.checkStateMachineIn("receiveOrClosed")
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
@@ -146,12 +146,12 @@ fun createTextForCoroutineHelpers(isReleaseCoroutines: Boolean, checkStateMachin
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun checkNoStateMachineIn(method: String) {
|
fun checkNoStateMachineIn(method: String) {
|
||||||
stackTrace.find { it?.methodName == method }?.let { error("tail-call optimization miss: method at " + it + " has state-machine " +
|
stackTrace.find { it?.methodName?.startsWith(method) == true }?.let { error("tail-call optimization miss: method at " + it + " has state-machine " +
|
||||||
stackTrace.joinToString(separator = "\n")) }
|
stackTrace.joinToString(separator = "\n")) }
|
||||||
}
|
}
|
||||||
|
|
||||||
fun checkStateMachineIn(method: String) {
|
fun checkStateMachineIn(method: String) {
|
||||||
stackTrace.find { it?.methodName == method } ?: error("tail-call optimization hit: method " + method + " has not state-machine " +
|
stackTrace.find { it?.methodName?.startsWith(method) == true } ?: error("tail-call optimization hit: method " + method + " has no state-machine " +
|
||||||
stackTrace.joinToString(separator = "\n"))
|
stackTrace.joinToString(separator = "\n"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user