-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use more specific error for secondary constructor bodies in inline cl…
…asses - Also, this error allows IDE to provide quick-fix that changes language version in a project that simplifies the adoption - There is no point in changing K2 part as there this feature will be enabled by default ^KT-56224 Fixed
- Loading branch information
1 parent
e09cd0b
commit 9d488c6
Showing
12 changed files
with
61 additions
and
6 deletions.
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
...vel/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...s/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
6 changes: 6 additions & 0 deletions
6
...rg/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...ler/testData/diagnostics/tests/inlineClasses/reservedConstructorsBodyInKotlinPre19.fir.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// !LANGUAGE: -ValueClassesSecondaryConstructorWithBody | ||
// WITH_STDLIB | ||
|
||
@JvmInline | ||
value class Foo(val x: String) { | ||
constructor(i: Int) : this(i.toString()) <!SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS!>{ | ||
println(i) | ||
}<!> | ||
} |
9 changes: 9 additions & 0 deletions
9
compiler/testData/diagnostics/tests/inlineClasses/reservedConstructorsBodyInKotlinPre19.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// !LANGUAGE: -ValueClassesSecondaryConstructorWithBody | ||
// WITH_STDLIB | ||
|
||
@JvmInline | ||
value class Foo(val x: String) { | ||
constructor(i: Int) : this(i.toString()) <!UNSUPPORTED_FEATURE!>{<!> | ||
println(i) | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
compiler/testData/diagnostics/tests/inlineClasses/reservedConstructorsBodyInKotlinPre19.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package | ||
|
||
@kotlin.jvm.JvmInline public final value class Foo { | ||
public constructor Foo(/*0*/ i: kotlin.Int) | ||
public constructor Foo(/*0*/ x: kotlin.String) | ||
public final val x: kotlin.String | ||
public open override /*1*/ /*synthesized*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean | ||
public open override /*1*/ /*synthesized*/ fun hashCode(): kotlin.Int | ||
public open override /*1*/ /*synthesized*/ fun toString(): kotlin.String | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
...tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.