[FIR-TEST] Add test with ambiguity between java field and java accessor

This commit is contained in:
Dmitriy Novozhilov
2019-11-27 14:56:05 +03:00
parent 3c661dd142
commit 8085ec8b0b
3 changed files with 26 additions and 0 deletions
@@ -0,0 +1,16 @@
// FILE: A.java
public class A {
public int x;
public String getX() {
return ""
}
}
// FILE: main.kt
fun test(a: A) {
val int = a.<!AMBIGUITY!>x<!> // <- should be int
val string = a.getX()
}
@@ -0,0 +1,5 @@
FILE: main.kt
public final fun test(a: R|A|): R|kotlin/Unit| {
lval int: <ERROR TYPE REF: Ambiguity: x, [/A.x, /A.x]> = R|<local>/a|.<Ambiguity: x, [/A.x, /A.x]>#
lval string: R|ft<kotlin/String, kotlin/String?>!| = R|<local>/a|.R|/A.getX|()
}
@@ -883,6 +883,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
runTest("compiler/fir/resolve/testData/resolve/problems/javaAccessorConversion.kt");
}
@TestMetadata("javaFieldVsAccessor.kt")
public void testJavaFieldVsAccessor() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/problems/javaFieldVsAccessor.kt");
}
@TestMetadata("localFunctionsHiding.kt")
public void testLocalFunctionsHiding() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/problems/localFunctionsHiding.kt");