Fix 'No type in binding context for: <some class> from light class generation' exception
#KT-4668 Fixed
This commit is contained in:
@@ -198,6 +198,8 @@ class CodegenAnnotatingVisitor extends JetVisitorVoid {
|
|||||||
super.visitObjectDeclaration(declaration);
|
super.visitObjectDeclaration(declaration);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
if (!filter.shouldProcess(declaration)) return;
|
||||||
|
|
||||||
ClassDescriptor classDescriptor = bindingContext.get(CLASS, declaration);
|
ClassDescriptor classDescriptor = bindingContext.get(CLASS, declaration);
|
||||||
// working around a problem with shallow analysis
|
// working around a problem with shallow analysis
|
||||||
if (classDescriptor == null) return;
|
if (classDescriptor == null) return;
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package some
|
||||||
|
|
||||||
|
open class Test
|
||||||
|
object First: Test() // There's no info for Test in binding context
|
||||||
|
|
||||||
|
class Second {
|
||||||
|
fun <caret>foo(statement: First) { // Reference to First, to make lazy resolve put it into binding context
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// For KT-4668
|
||||||
@@ -51,6 +51,10 @@ public class JetJavaFacadeTest extends JetLightCodeInsightFixtureTestCase {
|
|||||||
doTestWrapMethod(false);
|
doTestWrapMethod(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testObjectSubclassing() {
|
||||||
|
doTestWrapMethod(true);
|
||||||
|
}
|
||||||
|
|
||||||
public void testDoNotWrapFunInAnonymousObject() {
|
public void testDoNotWrapFunInAnonymousObject() {
|
||||||
doTestWrapMethod(false);
|
doTestWrapMethod(false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user