1
0
mirror of https://github.com/mamoe/mirai.git synced 2025-03-28 16:50:09 +08:00

Check Requirement.rule on init

This commit is contained in:
Him188 2020-11-12 10:06:51 +08:00
parent 1657fbd5ac
commit 52eaf56e5a

View File

@ -94,6 +94,14 @@ internal constructor(
*/
val rule: String,
) {
init {
kotlin.runCatching {
parseRangeRequirement(rule)
}.onFailure {
throw java.lang.IllegalArgumentException("Syntax error: $rule", it)
}
}
@Transient
private val impl = SemVersionInternal.parseRangeRequirement(rule)