[FIR-TEST] Add test with ambiguity in static java scopes

This commit is contained in:
Dmitriy Novozhilov
2019-11-28 11:59:52 +03:00
parent 4759c16428
commit bb89fee431
3 changed files with 26 additions and 0 deletions
@@ -0,0 +1,17 @@
// FILE: A.java
class A {
public static final A VALUE = new A();
}
// FILE: B.java
class B extends A {
public static final B VALUE = new B();
}
// FILE: main.kt
fun main() {
val b = B.<!AMBIGUITY!>VALUE<!> // <- should be B
}
@@ -0,0 +1,4 @@
FILE: main.kt
public final fun main(): R|kotlin/Unit| {
lval b: <ERROR TYPE REF: Ambiguity: VALUE, [/B.VALUE, /A.VALUE]> = Q|B|.<Ambiguity: VALUE, [/B.VALUE, /A.VALUE]>#
}
@@ -893,6 +893,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
runTest("compiler/fir/resolve/testData/resolve/problems/javaFieldVsAccessor.kt");
}
@TestMetadata("javaStaticScopeInheritance.kt")
public void testJavaStaticScopeInheritance() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/problems/javaStaticScopeInheritance.kt");
}
@TestMetadata("localFunctionsHiding.kt")
public void testLocalFunctionsHiding() throws Exception {
runTest("compiler/fir/resolve/testData/resolve/problems/localFunctionsHiding.kt");