Override/Implement: Fix processing of unresolved types

#KT-17350 Fixed
This commit is contained in:
Alexey Sedunov
2018-06-08 16:34:48 +03:00
parent ed8b4b761a
commit 694997651a
8 changed files with 33 additions and 1 deletions
@@ -44,6 +44,8 @@ private fun KotlinType.approximateNonDynamicFlexibleTypes(
preferNotNull: Boolean = false,
preferStarForRaw: Boolean = false
): SimpleType {
if (this is ErrorType) return this
if (isFlexible()) {
val flexible = asFlexibleType()
val lowerClass = flexible.lowerBound.constructor.declarationDescriptor as? ClassDescriptor?
@@ -162,6 +162,7 @@ private val OVERRIDE_RENDERER = DescriptorRenderer.withOptions {
annotationFilter = {
it.type.constructor.declarationDescriptor?.annotations?.hasAnnotation(ExperimentalUsageChecker.EXPERIMENTAL_FQ_NAME) ?: false
}
presentableUnresolvedTypes = true
}
private fun PropertyDescriptor.wrap(): PropertyDescriptor {
@@ -0,0 +1,8 @@
// DISABLE-ERRORS
interface A<in TPipeline, out TBuilder : Any, TFeature : Any> {
fun install(pipeline: TPipeline, configure: TBuilder.() -> Unit): TFeature
}
class X : A<String, UnresolvedType, Unit> {
<caret>
}
@@ -0,0 +1,10 @@
// DISABLE-ERRORS
interface A<in TPipeline, out TBuilder : Any, TFeature : Any> {
fun install(pipeline: TPipeline, configure: TBuilder.() -> Unit): TFeature
}
class X : A<String, UnresolvedType, Unit> {
override fun install(pipeline: String, configure: UnresolvedType.() -> Unit) {
<selection><caret>TODO("not implemented") //To change body of created functions use File | Settings | File Templates.</selection>
}
}
@@ -289,4 +289,8 @@ class OverrideImplementTest : AbstractOverrideImplementTest() {
configureLanguageAndApiVersion(project, module, "1.3", "1.3")
doOverrideFileTest("targetFun")
}
fun testUnresolvedType() {
doOverrideFileTest()
}
}