Fixed EA-75251
This commit is contained in:
@@ -24,7 +24,7 @@ import com.intellij.openapi.editor.Editor
|
|||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.ConstructorDescriptor
|
import org.jetbrains.kotlin.descriptors.ConstructorDescriptor
|
||||||
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
|
import org.jetbrains.kotlin.descriptors.VariableDescriptor
|
||||||
import org.jetbrains.kotlin.diagnostics.Diagnostic
|
import org.jetbrains.kotlin.diagnostics.Diagnostic
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
import org.jetbrains.kotlin.idea.caches.resolve.analyze
|
||||||
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
import org.jetbrains.kotlin.idea.caches.resolve.getResolutionFacade
|
||||||
@@ -160,7 +160,7 @@ object SuperClassNotInitialized : KotlinIntentionActionsFactory() {
|
|||||||
val nameString = parameter.name.asString()
|
val nameString = parameter.name.asString()
|
||||||
val existingParameter = oldParameters.firstOrNull { it.name == nameString }
|
val existingParameter = oldParameters.firstOrNull { it.name == nameString }
|
||||||
if (existingParameter != null) {
|
if (existingParameter != null) {
|
||||||
val type = (existingParameter.resolveToDescriptor() as ValueParameterDescriptor).type
|
val type = (existingParameter.resolveToDescriptor() as VariableDescriptor).type
|
||||||
if (type.isSubtypeOf(parameter.type)) continue // use existing parameter
|
if (type.isSubtypeOf(parameter.type)) continue // use existing parameter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
// "Add constructor parameters from Base(Int, Int, Any, String, String)" "true"
|
// "Add constructor parameters from Base(Int, Int, Any, String, String,...)" "true"
|
||||||
// ERROR: Redeclaration: p4
|
// ERROR: Redeclaration: p4
|
||||||
// ERROR: Redeclaration: p4
|
// ERROR: Redeclaration: p4
|
||||||
// ERROR: Redeclaration: p4
|
// ERROR: Redeclaration: p4
|
||||||
// ERROR: Redeclaration: p4
|
// ERROR: Redeclaration: p4
|
||||||
open class Base<T>(p1: Int, private val p2: Int, p3: Any, p4: String, p5: T)
|
open class Base<T>(p1: Int, private val p2: Int, p3: Any, p4: String, p5: T, p6: Int)
|
||||||
|
|
||||||
class C(p: Int, p2: Int, p3: String, p4: Any, p5: String) : Base<String><caret>
|
class C(p: Int, p2: Int, p3: String, p4: Any, p5: String, val p6: Int) : Base<String><caret>
|
||||||
|
|||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
// "Add constructor parameters from Base(Int, Int, Any, String, String)" "true"
|
// "Add constructor parameters from Base(Int, Int, Any, String, String,...)" "true"
|
||||||
// ERROR: Redeclaration: p4
|
// ERROR: Redeclaration: p4
|
||||||
// ERROR: Redeclaration: p4
|
// ERROR: Redeclaration: p4
|
||||||
// ERROR: Redeclaration: p4
|
// ERROR: Redeclaration: p4
|
||||||
// ERROR: Redeclaration: p4
|
// ERROR: Redeclaration: p4
|
||||||
open class Base<T>(p1: Int, private val p2: Int, p3: Any, p4: String, p5: T)
|
open class Base<T>(p1: Int, private val p2: Int, p3: Any, p4: String, p5: T, p6: Int)
|
||||||
|
|
||||||
class C(p: Int, p2: Int, p3: String, p4: Any, p5: String, p1: Int, p4: String) : Base<String><caret>(p1, p2, p3, p4, p5)
|
class C(p: Int, p2: Int, p3: String, p4: Any, p5: String, val p6: Int, p1: Int, p4: String) : Base<String><caret>(p1, p2, p3, p4, p5, p6)
|
||||||
|
|||||||
Reference in New Issue
Block a user