Light Classes: Drop obsolete constraint which prevents generation of light methods for local class members

#KT-8892 Fixed
This commit is contained in:
Alexey Sedunov
2016-05-27 20:51:32 +03:00
parent d27f3c0189
commit cf8cf37d69
4 changed files with 5 additions and 9 deletions
+1
View File
@@ -177,6 +177,7 @@
###### Issues fixed ###### Issues fixed
- [`KT-8860`](https://youtrack.jetbrains.com/issue/KT-8860) Allow renaming class by constructor delegation call referencing primary constructor - [`KT-8860`](https://youtrack.jetbrains.com/issue/KT-8860) Allow renaming class by constructor delegation call referencing primary constructor
- [`KT-8892`](https://youtrack.jetbrains.com/issue/KT-8892) Suggest renaming base declarations on overriding members in object literals
- [`KT-9156`](https://youtrack.jetbrains.com/issue/KT-9156) Quote non-identifier names in Kotlin references - [`KT-9156`](https://youtrack.jetbrains.com/issue/KT-9156) Quote non-identifier names in Kotlin references
- [`KT-9157`](https://youtrack.jetbrains.com/issue/KT-9157) Fixed in-place rename of Kotlin expression referring Java declaration - [`KT-9157`](https://youtrack.jetbrains.com/issue/KT-9157) Fixed in-place rename of Kotlin expression referring Java declaration
- [`KT-9241`](https://youtrack.jetbrains.com/issue/KT-9241) Do not replace Java references to synthetic component functions when renaming constructor parameter - [`KT-9241`](https://youtrack.jetbrains.com/issue/KT-9241) Do not replace Java references to synthetic component functions when renaming constructor parameter
@@ -417,6 +417,7 @@ open class KtLightClassForExplicitDeclaration(
private fun predictFqName(classOrObject: KtClassOrObject): FqName? { private fun predictFqName(classOrObject: KtClassOrObject): FqName? {
if (classOrObject.isLocal()) { if (classOrObject.isLocal()) {
if (classOrObject.containingFile.virtualFile == null) return null
val data = getLightClassDataExactly(classOrObject) val data = getLightClassDataExactly(classOrObject)
return data?.jvmQualifiedName return data?.jvmQualifiedName
} }
@@ -162,12 +162,6 @@ object LightClassUtil {
return declaration.getContainingClassOrObject().toLightClass() return declaration.getContainingClassOrObject().toLightClass()
} }
if (!canGenerateLightClass(declaration)) {
// Can't get wrappers for internal declarations. Their classes are not generated during calcStub
// with ClassBuilderMode.LIGHT_CLASSES mode, and this produces "Class not found exception" in getDelegate()
return null
}
val parent = declaration.parent val parent = declaration.parent
if (parent is KtFile) { if (parent is KtFile) {
@@ -45,7 +45,7 @@ public class KotlinJavaFacadeTest extends KotlinLightCodeInsightFixtureTestCase
} }
public void testDoNotWrapFunFromLocalClass() { public void testDoNotWrapFunFromLocalClass() {
doTestWrapMethod(false); doTestWrapMethod(true);
} }
public void testObjectSubclassing() { public void testObjectSubclassing() {
@@ -53,7 +53,7 @@ public class KotlinJavaFacadeTest extends KotlinLightCodeInsightFixtureTestCase
} }
public void testDoNotWrapFunInAnonymousObject() { public void testDoNotWrapFunInAnonymousObject() {
doTestWrapMethod(false); doTestWrapMethod(true);
} }
public void testWrapFunInClassWithoutBody() { public void testWrapFunInClassWithoutBody() {
@@ -145,7 +145,7 @@ public class KotlinJavaFacadeTest extends KotlinLightCodeInsightFixtureTestCase
} }
public void testWrapVarPropertyInLocalClass() { public void testWrapVarPropertyInLocalClass() {
doTestWrapProperty(false, false); doTestWrapProperty(true, true);
} }
public void testWrapVarTopLevelAccessor() { public void testWrapVarTopLevelAccessor() {