KT-2752: fix name clash diagnostic for case of extension property. Add more tests for the diagnostic

This commit is contained in:
Alexey Andreev
2016-05-27 17:04:34 +03:00
parent 8f829557c8
commit 8738458c34
9 changed files with 91 additions and 9 deletions
@@ -0,0 +1,8 @@
package foo
class A
<!JS_NAME_CLASH!>fun A.get_bar() = 23<!>
val A.bar: Int
<!JS_NAME_CLASH!>get() = 42<!>
@@ -0,0 +1,13 @@
package
package foo {
public val foo.A.bar: kotlin.Int
public fun foo.A.get_bar(): kotlin.Int
public final class A {
public constructor 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,8 @@
package foo
class A
fun A.bar() = 32
val A.bar: Int
get() = 32
@@ -0,0 +1,13 @@
package
package foo {
public val foo.A.bar: kotlin.Int
public fun foo.A.bar(): kotlin.Int
public final class A {
public constructor 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,5 @@
package foo
<!JS_NAME_CLASH!>fun bar(x: Int) = x<!>
<!JS_NAME_CLASH!>fun `bar_za3lpa$`() = 42<!>
@@ -0,0 +1,6 @@
package
package foo {
public fun bar(/*0*/ x: kotlin.Int): kotlin.Int
public fun `bar_za3lpa$`(): kotlin.Int
}
@@ -307,6 +307,24 @@ public class DiagnosticsTestWithJsStdLibGenerated extends AbstractDiagnosticsTes
doTest(fileName);
}
@TestMetadata("extensionPropertyAndMethod.kt")
public void testExtensionPropertyAndMethod() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/name/extensionPropertyAndMethod.kt");
doTest(fileName);
}
@TestMetadata("extensionPropertyAndMethodDoNotClash.kt")
public void testExtensionPropertyAndMethodDoNotClash() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/name/extensionPropertyAndMethodDoNotClash.kt");
doTest(fileName);
}
@TestMetadata("methodAndMethod.kt")
public void testMethodAndMethod() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/name/methodAndMethod.kt");
doTest(fileName);
}
@TestMetadata("methodAndPrivatePropertyDoNotClash.kt")
public void testMethodAndPrivatePropertyDoNotClash() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithJsStdLib/name/methodAndPrivatePropertyDoNotClash.kt");