mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-27 00:30:17 +08:00
Check Requirement.rule on init
This commit is contained in:
parent
1657fbd5ac
commit
52eaf56e5a
@ -94,6 +94,14 @@ internal constructor(
|
|||||||
*/
|
*/
|
||||||
val rule: String,
|
val rule: String,
|
||||||
) {
|
) {
|
||||||
|
init {
|
||||||
|
kotlin.runCatching {
|
||||||
|
parseRangeRequirement(rule)
|
||||||
|
}.onFailure {
|
||||||
|
throw java.lang.IllegalArgumentException("Syntax error: $rule", it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
private val impl = SemVersionInternal.parseRangeRequirement(rule)
|
private val impl = SemVersionInternal.parseRangeRequirement(rule)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user