Patch by Sergey Ignatov:
KT-841 Add constructor by default for abstract classes from Java
This commit is contained in:
+5
-1
@@ -163,7 +163,11 @@ public class JavaDescriptorResolver {
|
|||||||
PsiMethod[] psiConstructors = psiClass.getConstructors();
|
PsiMethod[] psiConstructors = psiClass.getConstructors();
|
||||||
|
|
||||||
if (psiConstructors.length == 0) {
|
if (psiConstructors.length == 0) {
|
||||||
if (!psiClass.hasModifierProperty(PsiModifier.ABSTRACT) && !psiClass.isInterface()) {
|
// We need to create default constructors for classes and abstract classes.
|
||||||
|
// Example:
|
||||||
|
// class Kotlin() : Java() {}
|
||||||
|
// abstract public class Java {}
|
||||||
|
if (!psiClass.isInterface()) {
|
||||||
ConstructorDescriptorImpl constructorDescriptor = new ConstructorDescriptorImpl(
|
ConstructorDescriptorImpl constructorDescriptor = new ConstructorDescriptorImpl(
|
||||||
classDescriptor,
|
classDescriptor,
|
||||||
Collections.<AnnotationDescriptor>emptyList(),
|
Collections.<AnnotationDescriptor>emptyList(),
|
||||||
|
|||||||
Reference in New Issue
Block a user