[NI] Relax requirement for stub types in builder-inference
For functions with implicit return type annotations will be replaced anyway in order to initialize return type, so this restriction in `StubType` was too strong #KT-30656 Fixed
This commit is contained in:
+2
-2
@@ -28,10 +28,10 @@ val test2 = generate {
|
|||||||
|
|
||||||
val test3 = <!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>generate<!> {
|
val test3 = <!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>generate<!> {
|
||||||
yield(3)
|
yield(3)
|
||||||
yieldBarReturnType(3)
|
<!NI;NON_APPLICABLE_CALL_FOR_BUILDER_INFERENCE!>yieldBarReturnType(3)<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
val test4 = <!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>generate<!> {
|
val test4 = <!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>generate<!> {
|
||||||
yield(3)
|
yield(3)
|
||||||
barReturnType()
|
<!NI;NON_APPLICABLE_CALL_FOR_BUILDER_INFERENCE!>barReturnType()<!>
|
||||||
}
|
}
|
||||||
+1
-1
@@ -4,7 +4,7 @@ public val test1: kotlin.collections.List<kotlin.Int>
|
|||||||
public val test2: kotlin.collections.List<kotlin.Int>
|
public val test2: kotlin.collections.List<kotlin.Int>
|
||||||
public val test3: kotlin.collections.List<kotlin.Int>
|
public val test3: kotlin.collections.List<kotlin.Int>
|
||||||
public val test4: kotlin.collections.List<kotlin.Int>
|
public val test4: kotlin.collections.List<kotlin.Int>
|
||||||
public fun </*0*/ S> generate(/*0*/ g: suspend GenericController<S>.() -> kotlin.Unit): kotlin.collections.List<S>
|
public fun </*0*/ S> generate(/*0*/ @kotlin.BuilderInference g: suspend GenericController<S>.() -> kotlin.Unit): kotlin.collections.List<S>
|
||||||
|
|
||||||
public final class GenericController</*0*/ T> {
|
public final class GenericController</*0*/ T> {
|
||||||
public constructor GenericController</*0*/ T>()
|
public constructor GenericController</*0*/ T>()
|
||||||
|
|||||||
@@ -24,9 +24,7 @@ class StubType(
|
|||||||
override val annotations: Annotations
|
override val annotations: Annotations
|
||||||
get() = Annotations.EMPTY
|
get() = Annotations.EMPTY
|
||||||
|
|
||||||
override fun replaceAnnotations(newAnnotations: Annotations): SimpleType {
|
override fun replaceAnnotations(newAnnotations: Annotations): SimpleType = this
|
||||||
error("Shouldn't be called on non-fixed type")
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun makeNullableAsSpecified(newNullability: Boolean): SimpleType {
|
override fun makeNullableAsSpecified(newNullability: Boolean): SimpleType {
|
||||||
return if (newNullability == isMarkedNullable)
|
return if (newNullability == isMarkedNullable)
|
||||||
|
|||||||
Reference in New Issue
Block a user