Zappo
10/29/2018, 7:08 PMmeasureTimeMillisWithResult
already exist in the codebase (core/util.runtime/src/org/jetbrains/kotlin/utils/addToStdlib.kt
and plugins/kapt3/kapt3-base/src/org/jetbrains/kotlin/kapt3/base/util/misc.kt
) which could be replaced by the fixed version proposed.dsavvinov
10/29/2018, 7:54 PMcallsInPlace
contract to measureTimeMillis
. This most probably will be accepted, as it is quite sane proposition, but I don't think Kotlin compatibility policy allows releasing such changes in incremental (1.3.X) updates.
- change behavior of measureTimeMillis
-- this is more deep design question, and it has to be discussed (and all alternatives should be considered) before implementing anything
- yes, when (and if) stdlib will have such API, it totally make sense to migrate compiler codebase to those changes.
Regardless, I highly suggest to create YouTrack issues for each of those, because they need different kinds of discussion (and may actually have different resolutions)Zappo
10/29/2018, 8:30 PMmeasureTimeMillis
I don't think I need to take action, as there's already a ticket.dsavvinov
10/29/2018, 9:41 PMmeasureTimeMillis
in stdlib, say, 1.3.40. Then, code like from your initial example will be compilable against stdlib 1.3.40, but it will be a error against earlier 1.3.X versions, like 1.3.30 (because 1.3.30 hadn't had contract on measureTimeMillis
)
And we already have one 1.3.X version without contract on measureTimeMillis
-- 1.3.0 (which is, admittedly, our fault).
That being said, those rules are not something set in stone, so there can be exceptions, but it requires more formal process of approvalZappo
10/29/2018, 9:45 PM