[FIR] Implement checker for missing dependency supertypes

#KT-60778 Fixed
This commit is contained in:
Brian Norman
2023-09-11 09:44:55 -05:00
committed by Space Team
parent a72eafc92b
commit 365ce2a6a5
33 changed files with 403 additions and 76 deletions
@@ -0,0 +1,7 @@
compiler/testData/compileKotlinAgainstCustomBinaries/computeSupertypeWithMissingDependency/source.kt:7:11: error: cannot access class 'a.A'. Check your module classpath for missing or conflicting dependencies.
b.foo()
^
compiler/testData/compileKotlinAgainstCustomBinaries/computeSupertypeWithMissingDependency/source.kt:9:11: error: cannot access class 'a.A'. Check your module classpath for missing or conflicting dependencies.
b.bar()
^
COMPILATION_ERROR
@@ -0,0 +1,34 @@
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyErrorPositions/source.kt:3:1: error: cannot access 'test.Super' which is a supertype of 'SubSub'. Check your module classpath for missing or conflicting dependencies.
class SubSub : Sub()
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyErrorPositions/source.kt:4:14: error: cannot access 'test.Super' which is a supertype of 'test.Sub'. Check your module classpath for missing or conflicting dependencies.
class Client<T : Sub>(val prop: T)
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyErrorPositions/source.kt:5:6: error: cannot access 'test.Super' which is a supertype of 'test.Sub'. Check your module classpath for missing or conflicting dependencies.
fun <T : Sub> withTypeParam() {}
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyErrorPositions/source.kt:12:11: error: cannot access 'test.Super' which is a supertype of 'test.Sub'. Check your module classpath for missing or conflicting dependencies.
Sub().unresolved()
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyErrorPositions/source.kt:12:11: error: unresolved reference 'unresolved'.
Sub().unresolved()
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyErrorPositions/source.kt:13:14: error: cannot access 'test.Super' which is a supertype of 'SubSub'. Check your module classpath for missing or conflicting dependencies.
SubSub().unresolved()
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyErrorPositions/source.kt:13:14: error: unresolved reference 'unresolved'.
SubSub().unresolved()
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyErrorPositions/source.kt:14:15: error: cannot access 'test.Super' which is a supertype of '<anonymous>'. Check your module classpath for missing or conflicting dependencies.
val obj = object : Sub() {}
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyErrorPositions/source.kt:15:25: error: cannot access 'test.Super' which is a supertype of 'test.Sub'. Check your module classpath for missing or conflicting dependencies.
withCallRefArg(Sub::resolved)
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyErrorPositions/source.kt:16:11: error: cannot access 'test.Super' which is a supertype of 'test.Sub'. Check your module classpath for missing or conflicting dependencies.
Sub().resolved()
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyErrorPositions/source.kt:17:11: error: cannot access 'test.Super' which is a supertype of 'test.Sub'. Check your module classpath for missing or conflicting dependencies.
Sub().extension()
^
COMPILATION_ERROR
@@ -0,0 +1,10 @@
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInJava/source.kt:3:1: error: cannot access 'test.Super' which is a supertype of 'SubSub'. Check your module classpath for missing or conflicting dependencies.
class SubSub : Sub()
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInJava/source.kt:5:22: error: cannot access 'test.Super' which is a supertype of 'SubSub'. Check your module classpath for missing or conflicting dependencies.
fun bar() = SubSub().foo()
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInJava/source.kt:5:22: error: unresolved reference 'foo'.
fun bar() = SubSub().foo()
^
COMPILATION_ERROR
@@ -0,0 +1,10 @@
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInKotlin/source.kt:3:1: error: cannot access 'test.Super' which is a supertype of 'SubSub'. Check your module classpath for missing or conflicting dependencies.
class SubSub : Sub()
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInKotlin/source.kt:5:22: error: cannot access 'test.Super' which is a supertype of 'SubSub'. Check your module classpath for missing or conflicting dependencies.
fun bar() = SubSub().foo()
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInKotlin/source.kt:5:22: error: unresolved reference 'foo'.
fun bar() = SubSub().foo()
^
COMPILATION_ERROR
@@ -0,0 +1,4 @@
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyMissingInterface/source.kt:5:15: error: cannot access 'test.A' which is a supertype of 'test.B'. Check your module classpath for missing or conflicting dependencies.
D.m(B.n())
^
COMPILATION_ERROR
@@ -0,0 +1,4 @@
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyOfEnclosingClass/source.kt:6:16: error: cannot access 'test.Super' which is a supertype of 'test.SubClass'. Check your module classpath for missing or conflicting dependencies.
SubClass().Inner() // Error - dispatch receiver misses supertype
^
COMPILATION_ERROR
@@ -0,0 +1,16 @@
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyWithExtendedCompilerChecks/source.kt:12:32: error: cannot access 'test.Super' which is a supertype of 'test.Sub'. Check your module classpath for missing or conflicting dependencies.
fun simpleFun(arg: Sub): Sub = Sub()
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyWithExtendedCompilerChecks/source.kt:19:18: error: cannot access 'test.Super' which is a supertype of 'test.Sub'. Check your module classpath for missing or conflicting dependencies.
val x: Sub = Sub()
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyWithExtendedCompilerChecks/source.kt:21:18: error: cannot access 'test.Super' which is a supertype of 'test.Sub'. Check your module classpath for missing or conflicting dependencies.
useCallRef(::Sub)
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyWithExtendedCompilerChecks/source.kt:22:15: error: cannot access 'test.Super' which is a supertype of 'test.Sub'. Check your module classpath for missing or conflicting dependencies.
simpleFun(Sub())
^
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyWithExtendedCompilerChecks/source.kt:23:20: error: cannot access 'test.Super' which is a supertype of 'test.Sub'. Check your module classpath for missing or conflicting dependencies.
inlineFun<Sub>(Sub())
^
COMPILATION_ERROR
@@ -0,0 +1,25 @@
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyConflictingLibraries/source.kt:7:8: error: cannot access class 'a.A.Inner'. Check your module classpath for missing or conflicting dependencies.
b2.consumeA(b1.produceA())
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyConflictingLibraries/source.kt:7:20: error: cannot access class 'a.A.Inner'. Check your module classpath for missing or conflicting dependencies.
b2.consumeA(b1.produceA())
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyConflictingLibraries/source.kt:8:8: error: cannot access class 'a.A.Inner'. Check your module classpath for missing or conflicting dependencies.
b2.consumeA(b1.produceAGeneric("foo"))
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyConflictingLibraries/source.kt:8:20: error: cannot access class 'a.A.Inner'. Check your module classpath for missing or conflicting dependencies.
b2.consumeA(b1.produceAGeneric("foo"))
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyConflictingLibraries/source.kt:12:8: error: cannot access class 'a.AA.Inner'. Check your module classpath for missing or conflicting dependencies.
b2.consumeAA(b1.produceAA())
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyConflictingLibraries/source.kt:12:21: error: cannot access class 'a.AA.Inner'. Check your module classpath for missing or conflicting dependencies.
b2.consumeAA(b1.produceAA())
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyConflictingLibraries/source.kt:16:8: error: cannot access class 'a.AAA.Inner.InnerInner'. Check your module classpath for missing or conflicting dependencies.
b2.consumeAAA(b1.produceAAA())
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyConflictingLibraries/source.kt:16:22: error: cannot access class 'a.AAA.Inner.InnerInner'. Check your module classpath for missing or conflicting dependencies.
b2.consumeAAA(b1.produceAAA())
^
COMPILATION_ERROR
@@ -0,0 +1,10 @@
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyDifferentCases/source.kt:6:7: error: cannot access class 'a.A'. Check your module classpath for missing or conflicting dependencies.
b.returnType()
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyDifferentCases/source.kt:7:7: error: cannot access class 'a.A'. Check your module classpath for missing or conflicting dependencies.
b.parameter(null)
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyDifferentCases/source.kt:8:10: error: cannot access class 'a.A'. Check your module classpath for missing or conflicting dependencies.
null.extensionReceiver()
^
COMPILATION_ERROR
@@ -0,0 +1,10 @@
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyJava/source.kt:4:17: error: cannot access class 'test.Bar'. Check your module classpath for missing or conflicting dependencies.
val bar = f.getBar()
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyJava/source.kt:5:5: error: cannot access class 'test.Bar'. Check your module classpath for missing or conflicting dependencies.
bar.bar()
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyJava/source.kt:5:9: error: unresolved reference 'bar'.
bar.bar()
^
COMPILATION_ERROR
@@ -0,0 +1,7 @@
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyJavaConflictingLibraries/source.kt:4:8: error: cannot access class 'test.A.Inner'. Check your module classpath for missing or conflicting dependencies.
b2.consumeA(b1.produceA())
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencyJavaConflictingLibraries/source.kt:4:20: error: cannot access class 'test.A.Inner'. Check your module classpath for missing or conflicting dependencies.
b2.consumeA(b1.produceA())
^
COMPILATION_ERROR
@@ -0,0 +1,13 @@
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencySimple/source.kt:7:7: error: cannot access class 'a.A'. Check your module classpath for missing or conflicting dependencies.
b.foo()
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencySimple/source.kt:10:21: error: initializer type mismatch: expected 'kotlin.String', actual 'a.A'.
val x: String = b.foo()
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencySimple/source.kt:10:21: error: type mismatch: inferred type is 'a.A', but 'kotlin.String' was expected.
val x: String = b.foo()
^
compiler/testData/compileKotlinAgainstCustomBinaries/missingDependencySimple/source.kt:10:23: error: cannot access class 'a.A'. Check your module classpath for missing or conflicting dependencies.
val x: String = b.foo()
^
COMPILATION_ERROR
@@ -0,0 +1,4 @@
compiler/testData/compileKotlinAgainstCustomBinaries/missingStaticClass/source.kt:4:15: error: cannot access class 'test.C.D'. Check your module classpath for missing or conflicting dependencies.
val c = C.makeD()
^
COMPILATION_ERROR