
Compiler plugin adding runtime and compile-time checks: integer overflow and precision validation, collection destructuring size enforcement, and @Memoize function-result caching optimized for 0–3 args.
A Kotlin compiler plugin providing some useful-for-scripting checks.
Int and Long, for built-in operations
as well as the Iterable extension functionsInt to Float or from Long to either floating-point type is checked for precision,
where any number too large to be guaranteed to be exactly represented will throw an exception@SkipOverflowChecks
val (a, b, c) = myList), all elements of the list must be accounted
for, otherwise an exception is thrownval (a, _, _) = myList will silence the
checks without requiring unused names for the other parameters, while still enforcing the list to have a size of 3)@SkipDestructuringChecks
@Memoize annotation on functions
lazy
1 On JVM, setting chekt.warnOnNegativeRemainder to "false" will disable the warning. On native platforms,
setting KT_REM_WARNINGS environment variable to false will disable the warning. On JS, setting any value to a
cookie called chekt.warnOnNegativeRemainder will disable the warning.
Apply to a Gradle project:
plugins {
// kotlin("...") version "..."
id("com.sschr15.chekt") version "(Gradle plugin version)"
}This will automatically apply the compiler plugin.
A Kotlin compiler plugin providing some useful-for-scripting checks.
Int and Long, for built-in operations
as well as the Iterable extension functionsInt to Float or from Long to either floating-point type is checked for precision,
where any number too large to be guaranteed to be exactly represented will throw an exception@SkipOverflowChecks
val (a, b, c) = myList), all elements of the list must be accounted
for, otherwise an exception is thrownval (a, _, _) = myList will silence the
checks without requiring unused names for the other parameters, while still enforcing the list to have a size of 3)@SkipDestructuringChecks
@Memoize annotation on functions
lazy
1 On JVM, setting chekt.warnOnNegativeRemainder to "false" will disable the warning. On native platforms,
setting KT_REM_WARNINGS environment variable to false will disable the warning. On JS, setting any value to a
cookie called chekt.warnOnNegativeRemainder will disable the warning.
Apply to a Gradle project:
plugins {
// kotlin("...") version "..."
id("com.sschr15.chekt") version "(Gradle plugin version)"
}This will automatically apply the compiler plugin.