Deprecate precondition checks with non-lazy message.

Make precondition checks with lazy message inline.
Use require with lazy message in stdlib.
#KT-8253 Fixed
This commit is contained in:
Ilya Gorbunov
2015-09-04 19:20:54 +03:00
parent a59962c620
commit c14f376d21
3 changed files with 50 additions and 11 deletions
@@ -108,7 +108,7 @@ fun filtering(): List<GenericFunction> {
body(ArraysOfObjects, ArraysOfPrimitives) {
"""
require(n >= 0, "Requested element count $n is less than zero.")
require(n >= 0) { "Requested element count $n is less than zero." }
if (n == 0) return emptyList()
if (n >= size()) return toList()
var count = 0