-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
코틀린 버전을 1.6.21로 올린다. #563
Labels
디자인
Improvements or additions to documentation
Comments
1.6
// 1.5
val <T> T.exhaustive: T
get() = this
enum class Suit {
CLUBS, DIAMONDS, HEARTS, SPADES
}
fun Suit.toPattern(): String {
when(this) { // Okay
Suit.CLUBS -> "♣"
}
when(this) { // Error
Suit.CLUBS -> "♣"
}.exhaustive
return when(this) { // Error
Suit.CLUBS -> "♣"
}
} // 1.6
val <T> T.exhaustive: T
get() = this
enum class Suit {
CLUBS, DIAMONDS, HEARTS, SPADES
}
fun Suit.toPattern(): String {
when(this) { // Warning
Suit.CLUBS -> "♣"
}
when(this) { // Error
Suit.CLUBS -> "♣"
}.exhaustive
return when(this) { // Error
Suit.CLUBS -> "♣"
}
}
// 1.5
val name = readLine()!!
val nickname = readLine()
println("Hello, ${nickname ?: name}!") // 1.6
val name = readln()
val nickname = readlnOrNull()
println("Hello, ${nickname?: name}!")
// 1.6
val fromExplicitType: KType = typeOf<Int>()
// 1.6
val x = listOf('b', 'c')
val y = buildList {
add('a')
addAll(x)
add('d')
}
println(y) // [a, b, c, d]
// 1.6
val duration = 10000
println("There are ${duration.seconds.inWholeMinutes} minutes in $duration seconds")
// There are 166 minutes in 10000 seconds
// 1.6
val number: Short = 0b10001 // 16-bit
println(number.rotateLeft(2).toString(2)) // 1000100
println(number.rotateRight(2).toString(2)) // 100000000000100 |
1.7
문제스프링 부트 2.3.3에서 코틀린 버전을 1.7.10으로 올리면 아래 예외가 발생한다.
해결 방법
원인
// 2.3.x
// KotlinPluginAction.java#L34-L42
@Override
public void execute(Project project) {
String kotlinVersion = project.getPlugins().getPlugin(KotlinPluginWrapper.class).getKotlinPluginVersion();
ExtraPropertiesExtension extraProperties = project.getExtensions().getExtraProperties();
if (!extraProperties.has("kotlin.version")) {
extraProperties.set("kotlin.version", kotlinVersion);
}
enableJavaParametersOption(project);
} // 2.4.x 이후
// KotlinPluginAction.java#L34-L42
@Override
public void execute(Project project) {
ExtraPropertiesExtension extraProperties = project.getExtensions().getExtraProperties();
if (!extraProperties.has("kotlin.version")) {
String kotlinVersion = project.getPlugins().getPlugin(KotlinPluginWrapper.class).getKotlinPluginVersion();
extraProperties.set("kotlin.version", kotlinVersion);
}
enableJavaParametersOption(project);
} // 2.5.x 이후
// KotlinPluginAction.java#L35-L47
@Override
public void execute(Project project) {
ExtraPropertiesExtension extraProperties = project.getExtensions().getExtraProperties();
if (!extraProperties.has("kotlin.version")) {
String kotlinVersion = getKotlinVersion(project);
extraProperties.set("kotlin.version", kotlinVersion);
}
enableJavaParametersOption(project);
}
private String getKotlinVersion(Project project) {
return KotlinPluginWrapperKt.getKotlinPluginVersion(project);
} 참고 자료
|
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
참고 자료
관련 이슈: #246
The text was updated successfully, but these errors were encountered: