Deprecations: data class should now have at least one primary constructor parameter, parameters should be val / var and not vararg.
This commit is contained in:
@@ -382,6 +382,10 @@ public interface Errors {
|
||||
DiagnosticFactory2<JetClassOrObject, Collection<? extends CallableMemberDescriptor>, Integer> DIFFERENT_NAMES_FOR_THE_SAME_PARAMETER_IN_SUPERTYPES =
|
||||
DiagnosticFactory2.create(WARNING, DECLARATION_NAME);
|
||||
|
||||
DiagnosticFactory0<PsiElement> DATA_CLASS_WITHOUT_PARAMETERS = DiagnosticFactory0.create(WARNING);
|
||||
DiagnosticFactory0<JetParameter> DATA_CLASS_VARARG_PARAMETER = DiagnosticFactory0.create(WARNING);
|
||||
DiagnosticFactory0<JetParameter> DATA_CLASS_NOT_PROPERTY_PARAMETER = DiagnosticFactory0.create(WARNING);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Errors/warnings inside code blocks
|
||||
|
||||
+4
@@ -622,6 +622,10 @@ public class DefaultErrorMessages {
|
||||
"Names of the parameter #{1} conflict in the following members of supertypes: ''{0}''. " +
|
||||
"This may cause problems when calling this function with named arguments.", commaSeparated(FQ_NAMES_IN_TYPES), TO_STRING);
|
||||
|
||||
MAP.put(DATA_CLASS_WITHOUT_PARAMETERS, "Data class without primary constructor parameters are deprecated");
|
||||
MAP.put(DATA_CLASS_VARARG_PARAMETER, "Primary constructor vararg parameters are deprecated for data classes");
|
||||
MAP.put(DATA_CLASS_NOT_PROPERTY_PARAMETER, "Primary constructor parameters without val / var are deprecated for data classes");
|
||||
|
||||
MAP.put(AMBIGUOUS_ANONYMOUS_TYPE_INFERRED, "Right-hand side has anonymous type. Please specify type explicitly", TO_STRING);
|
||||
|
||||
MAP.put(EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED,
|
||||
|
||||
@@ -36,6 +36,19 @@ public class DataClassAnnotationChecker : DeclarationChecker {
|
||||
if (descriptor.getUnsubstitutedPrimaryConstructor() == null && descriptor.getConstructors().isNotEmpty()) {
|
||||
diagnosticHolder.report(Errors.PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS.on(declaration.getNameIdentifier()));
|
||||
}
|
||||
val primaryConstructor = declaration.getPrimaryConstructor()
|
||||
val parameters = primaryConstructor?.valueParameters ?: emptyList()
|
||||
if (parameters.isEmpty()) {
|
||||
diagnosticHolder.report(Errors.DATA_CLASS_WITHOUT_PARAMETERS.on(declaration.nameIdentifier!!))
|
||||
}
|
||||
for (parameter in parameters) {
|
||||
if (parameter.isVarArg) {
|
||||
diagnosticHolder.report(Errors.DATA_CLASS_VARARG_PARAMETER.on(parameter))
|
||||
}
|
||||
if (!parameter.hasValOrVar()) {
|
||||
diagnosticHolder.report(Errors.DATA_CLASS_NOT_PROPERTY_PARAMETER.on(parameter))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
annotation class base
|
||||
|
||||
@base data class My
|
||||
|
||||
@base data class My(val x: Int)
|
||||
@@ -1,8 +1,10 @@
|
||||
package
|
||||
|
||||
@base() @kotlin.data() public final class My {
|
||||
public constructor My()
|
||||
public final /*synthesized*/ fun copy(): My
|
||||
public constructor My(/*0*/ x: kotlin.Int)
|
||||
public final val x: kotlin.Int
|
||||
public final /*synthesized*/ fun component1(): kotlin.Int
|
||||
public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ...): My
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
data class A(<!UNUSED_PARAMETER!>x<!>: Int, <!UNUSED_PARAMETER!>y<!>: String)
|
||||
|
||||
fun foo(a: A) {
|
||||
a.<!UNRESOLVED_REFERENCE!>component1<!>()
|
||||
a.<!UNRESOLVED_REFERENCE!>component2<!>()
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ a: A): kotlin.Unit
|
||||
|
||||
@kotlin.data() public final class A {
|
||||
public constructor A(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String)
|
||||
public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String): A
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
data class My(val x: Int, <!DATA_CLASS_VARARG_PARAMETER!>vararg val y: String<!>)
|
||||
|
||||
data class Your(<!DATA_CLASS_VARARG_PARAMETER, DATA_CLASS_NOT_PROPERTY_PARAMETER!>vararg <!UNUSED_PARAMETER!>z<!>: String<!>)
|
||||
@@ -0,0 +1,21 @@
|
||||
package
|
||||
|
||||
@kotlin.data() public final class My {
|
||||
public constructor My(/*0*/ x: kotlin.Int, /*1*/ vararg y: kotlin.String /*kotlin.Array<out kotlin.String>*/)
|
||||
public final val x: kotlin.Int
|
||||
public final val y: kotlin.Array<out kotlin.String>
|
||||
public final /*synthesized*/ fun component1(): kotlin.Int
|
||||
public final /*synthesized*/ fun component2(): kotlin.Array<out kotlin.String>
|
||||
public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ vararg y: kotlin.String /*kotlin.Array<out kotlin.String>*/ = ...): My
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
@kotlin.data() public final class Your {
|
||||
public constructor Your(/*0*/ vararg z: kotlin.String /*kotlin.Array<out kotlin.String>*/)
|
||||
public final /*synthesized*/ fun copy(/*0*/ vararg z: kotlin.String /*kotlin.Array<out kotlin.String>*/): Your
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -6,6 +6,6 @@ open class NotAllowed
|
||||
|
||||
class Derived: Base(42)
|
||||
|
||||
<!DATA_CLASS_OVERRIDE_CONFLICT!>data<!> class Nasty(x: Int, val y: Int): <!DATA_CLASS_CANNOT_HAVE_CLASS_SUPERTYPES!>Base<!>(x)
|
||||
<!DATA_CLASS_OVERRIDE_CONFLICT!>data<!> class Nasty(val z: Int, val y: Int): <!DATA_CLASS_CANNOT_HAVE_CLASS_SUPERTYPES!>Base<!>(z)
|
||||
|
||||
data class Complex(val y: Int): Allowed, <!DATA_CLASS_CANNOT_HAVE_CLASS_SUPERTYPES!>NotAllowed<!>()
|
||||
@@ -37,12 +37,14 @@ public final class Derived : Base {
|
||||
}
|
||||
|
||||
@kotlin.data() public final class Nasty : Base {
|
||||
public constructor Nasty(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int)
|
||||
public constructor Nasty(/*0*/ z: kotlin.Int, /*1*/ y: kotlin.Int)
|
||||
public final override /*1*/ /*fake_override*/ val x: kotlin.Int
|
||||
public final val y: kotlin.Int
|
||||
public final val z: kotlin.Int
|
||||
public final override /*1*/ /*synthesized*/ fun component1(): kotlin.Int
|
||||
public final /*synthesized*/ fun component2(): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun copy(/*0*/ x: kotlin.Int = ...): Base
|
||||
public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int = ...): Nasty
|
||||
public final /*synthesized*/ fun copy(/*0*/ z: kotlin.Int = ..., /*1*/ y: kotlin.Int = ...): Nasty
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
data class A()
|
||||
data class <!DATA_CLASS_WITHOUT_PARAMETERS!>A<!>()
|
||||
|
||||
fun foo(a: A) {
|
||||
a.<!UNRESOLVED_REFERENCE!>component1<!>()
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
data class A(val x: Int, <!UNUSED_PARAMETER!>y<!>: String)
|
||||
|
||||
fun foo(a: A) {
|
||||
checkSubtype<Int>(a.component1())
|
||||
a.<!UNRESOLVED_REFERENCE!>component2<!>()
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ a: A): kotlin.Unit
|
||||
|
||||
@kotlin.data() public final class A {
|
||||
public constructor A(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String)
|
||||
public final val x: kotlin.Int
|
||||
public final /*synthesized*/ fun component1(): kotlin.Int
|
||||
public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.String): A
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
data class A(var x: Int, <!UNUSED_PARAMETER!>y<!>: String)
|
||||
|
||||
fun foo(a: A) {
|
||||
checkSubtype<Int>(a.component1())
|
||||
a.<!UNRESOLVED_REFERENCE!>component2<!>()
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ a: A): kotlin.Unit
|
||||
|
||||
@kotlin.data() public final class A {
|
||||
public constructor A(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String)
|
||||
public final var x: kotlin.Int
|
||||
public final /*synthesized*/ fun component1(): kotlin.Int
|
||||
public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.String): A
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
data class A
|
||||
data class <!DATA_CLASS_WITHOUT_PARAMETERS!>A<!>
|
||||
|
||||
fun foo(a: A) {
|
||||
a.<!UNRESOLVED_REFERENCE!>component1<!>()
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
data class A(foo: String, val bar: Int, other: Long) {
|
||||
val foo = foo
|
||||
val other = other
|
||||
}
|
||||
|
||||
fun test(a: A) {
|
||||
a.component1()
|
||||
a.<!UNRESOLVED_REFERENCE!>component2<!>()
|
||||
a.<!UNRESOLVED_REFERENCE!>component3<!>()
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
package
|
||||
|
||||
public fun test(/*0*/ a: A): kotlin.Unit
|
||||
|
||||
@kotlin.data() public final class A {
|
||||
public constructor A(/*0*/ foo: kotlin.String, /*1*/ bar: kotlin.Int, /*2*/ other: kotlin.Long)
|
||||
public final val bar: kotlin.Int
|
||||
public final val foo: kotlin.String
|
||||
public final val other: kotlin.Long
|
||||
public final /*synthesized*/ fun component1(): kotlin.Int
|
||||
public final /*synthesized*/ fun copy(/*0*/ foo: kotlin.String, /*1*/ bar: kotlin.Int = ..., /*2*/ other: kotlin.Long): A
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
data class A(<!UNUSED_PARAMETER!>x<!>: Int, val y: String)
|
||||
|
||||
fun foo(a: A) {
|
||||
checkSubtype<String>(a.component1())
|
||||
a.<!UNRESOLVED_REFERENCE!>component2<!>()
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ a: A): kotlin.Unit
|
||||
|
||||
@kotlin.data() public final class A {
|
||||
public constructor A(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String)
|
||||
public final val y: kotlin.String
|
||||
public final /*synthesized*/ fun component1(): kotlin.String
|
||||
public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String = ...): A
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// !CHECK_TYPE
|
||||
|
||||
data class A(<!UNUSED_PARAMETER!>x<!>: Int, var y: String)
|
||||
|
||||
fun foo(a: A) {
|
||||
checkSubtype<String>(a.component1())
|
||||
a.<!UNRESOLVED_REFERENCE!>component2<!>()
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ a: A): kotlin.Unit
|
||||
|
||||
@kotlin.data() public final class A {
|
||||
public constructor A(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String)
|
||||
public final var y: kotlin.String
|
||||
public final /*synthesized*/ fun component1(): kotlin.String
|
||||
public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.String = ...): A
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
data <!WRONG_MODIFIER_TARGET!>annotation<!> enum class E {
|
||||
<!WRONG_MODIFIER_TARGET!>annotation<!> enum class E {
|
||||
D
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
package
|
||||
|
||||
@kotlin.data() @kotlin.annotation.annotation() public final enum class E : kotlin.Enum<E> {
|
||||
@kotlin.annotation.annotation() public final enum class E : kotlin.Enum<E> {
|
||||
enum entry D
|
||||
|
||||
private constructor E()
|
||||
protected final override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public final override /*1*/ /*fake_override*/ fun compareTo(/*0*/ other: E): kotlin.Int
|
||||
public final /*synthesized*/ fun copy(): E
|
||||
public final override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public final override /*1*/ /*fake_override*/ fun name(): kotlin.String
|
||||
|
||||
@@ -3,10 +3,10 @@ data class A1(val x: String) {
|
||||
constructor(): this("")
|
||||
}
|
||||
|
||||
data class A2() {
|
||||
constructor(x: String): this()
|
||||
data class A2(val y: String, val z: Int) {
|
||||
constructor(x: String): this(x, 0)
|
||||
}
|
||||
|
||||
data class <!PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS!>A3<!> {
|
||||
data class <!PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS, DATA_CLASS_WITHOUT_PARAMETERS!>A3<!> {
|
||||
constructor()
|
||||
}
|
||||
|
||||
@@ -12,9 +12,13 @@ package
|
||||
}
|
||||
|
||||
@kotlin.data() public final class A2 {
|
||||
public constructor A2()
|
||||
public constructor A2(/*0*/ x: kotlin.String)
|
||||
public final /*synthesized*/ fun copy(): A2
|
||||
public constructor A2(/*0*/ y: kotlin.String, /*1*/ z: kotlin.Int)
|
||||
public final val y: kotlin.String
|
||||
public final val z: kotlin.Int
|
||||
public final /*synthesized*/ fun component1(): kotlin.String
|
||||
public final /*synthesized*/ fun component2(): kotlin.Int
|
||||
public final /*synthesized*/ fun copy(/*0*/ y: kotlin.String = ..., /*1*/ z: kotlin.Int = ...): A2
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
@@ -3294,12 +3294,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/dataClasses"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||
}
|
||||
|
||||
@TestMetadata("bothParamsAreNotProperties.kt")
|
||||
public void testBothParamsAreNotProperties() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dataClasses/bothParamsAreNotProperties.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("componentFunctionInSubClass.kt")
|
||||
public void testComponentFunctionInSubClass() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dataClasses/componentFunctionInSubClass.kt");
|
||||
@@ -3330,6 +3324,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("dataClassVarargParam.kt")
|
||||
public void testDataClassVarargParam() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dataClasses/dataClassVarargParam.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("dataInheritance.kt")
|
||||
public void testDataInheritance() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dataClasses/dataInheritance.kt");
|
||||
@@ -3342,18 +3342,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("firstParamIsVal.kt")
|
||||
public void testFirstParamIsVal() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dataClasses/firstParamIsVal.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("firstParamIsVar.kt")
|
||||
public void testFirstParamIsVar() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dataClasses/firstParamIsVar.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("implementTraitWhichHasComponent1.kt")
|
||||
public void testImplementTraitWhichHasComponent1() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dataClasses/implementTraitWhichHasComponent1.kt");
|
||||
@@ -3402,12 +3390,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("paramNameSameToField.kt")
|
||||
public void testParamNameSameToField() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dataClasses/paramNameSameToField.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("repeatedProperties.kt")
|
||||
public void testRepeatedProperties() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dataClasses/repeatedProperties.kt");
|
||||
@@ -3420,18 +3402,6 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("secondParamIsVal.kt")
|
||||
public void testSecondParamIsVal() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dataClasses/secondParamIsVal.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("secondParamIsVar.kt")
|
||||
public void testSecondParamIsVar() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dataClasses/secondParamIsVar.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("twoValParams.kt")
|
||||
public void testTwoValParams() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/dataClasses/twoValParams.kt");
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ fun foo() {
|
||||
//extract from library
|
||||
fun <K, V> hashMap(<warning>p</warning>: Pair<K, V>): MutableMap<K, V> {<error>}</error>
|
||||
fun <K, V> K.to(<warning>v</warning>: V): Pair<K, V> {<error>}</error>
|
||||
data class Pair<K, V> {}
|
||||
class Pair<K, V> {}
|
||||
Reference in New Issue
Block a user