Skip to content

Commit

Permalink
Give a better error message for --jvm-target (#4978)
Browse files Browse the repository at this point in the history
  • Loading branch information
yogurtearl committed Jun 22, 2022
1 parent 75f38dc commit 7832eef
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -55,5 +55,8 @@ internal fun CompilerSpec.parseLanguageVersion(): LanguageVersion? {
}

internal fun CompilerSpec.parseJvmTarget(): JvmTarget {
return checkNotNull(JvmTarget.fromString(jvmTarget)) { "Invalid value passed to --jvm-target" }
return checkNotNull(JvmTarget.fromString(jvmTarget)) {
"Invalid value ($jvmTarget) passed to --jvm-target," +
" must be one of ${JvmTarget.values().map(JvmTarget::description)}"
}
}

0 comments on commit 7832eef

Please sign in to comment.