[FIR] Don't analyze properties with implicit types twice
Test `cast.kt` now don't work absolutely correct and implicit type of value parameter in lambda is't replaced with error type, but it's minor bug
This commit is contained in:
+2
-4
@@ -578,9 +578,6 @@ open class FirBodyResolveTransformer(
|
|||||||
return super.transformPropertyAccessor(propertyAccessor, data)
|
return super.transformPropertyAccessor(propertyAccessor, data)
|
||||||
}
|
}
|
||||||
val returnTypeRef = propertyAccessor.returnTypeRef
|
val returnTypeRef = propertyAccessor.returnTypeRef
|
||||||
if (returnTypeRef !is FirImplicitTypeRef && implicitTypeOnly) {
|
|
||||||
return propertyAccessor.compose()
|
|
||||||
}
|
|
||||||
if (returnTypeRef is FirImplicitTypeRef && data !is FirResolvedTypeRef) {
|
if (returnTypeRef is FirImplicitTypeRef && data !is FirResolvedTypeRef) {
|
||||||
propertyAccessor.transformReturnTypeRef(StoreType, FirComputingImplicitTypeRef)
|
propertyAccessor.transformReturnTypeRef(StoreType, FirComputingImplicitTypeRef)
|
||||||
}
|
}
|
||||||
@@ -639,8 +636,8 @@ open class FirBodyResolveTransformer(
|
|||||||
enhancedTypeRef = returnTypeRef
|
enhancedTypeRef = returnTypeRef
|
||||||
}
|
}
|
||||||
setter?.let {
|
setter?.let {
|
||||||
it.transform<FirDeclaration, Any?>(this@FirBodyResolveTransformer, enhancedTypeRef)
|
|
||||||
it.valueParameters[0].transformReturnTypeRef(StoreType, enhancedTypeRef)
|
it.valueParameters[0].transformReturnTypeRef(StoreType, enhancedTypeRef)
|
||||||
|
it.transform<FirDeclaration, Any?>(this@FirBodyResolveTransformer, enhancedTypeRef)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -674,6 +671,7 @@ open class FirBodyResolveTransformer(
|
|||||||
override fun transformProperty(property: FirProperty, data: Any?): CompositeTransformResult<FirDeclaration> {
|
override fun transformProperty(property: FirProperty, data: Any?): CompositeTransformResult<FirDeclaration> {
|
||||||
val returnTypeRef = property.returnTypeRef
|
val returnTypeRef = property.returnTypeRef
|
||||||
if (returnTypeRef !is FirImplicitTypeRef && implicitTypeOnly) return property.compose()
|
if (returnTypeRef !is FirImplicitTypeRef && implicitTypeOnly) return property.compose()
|
||||||
|
if (property.resolvePhase == transformerPhase) return property.compose()
|
||||||
if (returnTypeRef is FirImplicitTypeRef) {
|
if (returnTypeRef is FirImplicitTypeRef) {
|
||||||
property.transformReturnTypeRef(StoreType, FirComputingImplicitTypeRef)
|
property.transformReturnTypeRef(StoreType, FirComputingImplicitTypeRef)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ FILE: cast.kt
|
|||||||
}
|
}
|
||||||
|
|
||||||
public get(): R|kotlin/Function1<kotlin/String, kotlin/Boolean>|
|
public get(): R|kotlin/Function1<kotlin/String, kotlin/Boolean>|
|
||||||
public final val hError: R|kotlin/Function1<class error: No type for parameter, kotlin/Boolean>| = fun <anonymous>(_: R|class error: No type for parameter|): R|kotlin/Boolean| {
|
public final val hError: R|kotlin/Function1<class error: No type for parameter, kotlin/Boolean>| = fun <anonymous>(_: <implicit>): R|kotlin/Boolean| {
|
||||||
Boolean(true)
|
Boolean(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ FILE fqName:<root> fileName:/justLambda.kt
|
|||||||
FUN_EXPR type=kotlin.Function0<kotlin.Int> origin=LAMBDA
|
FUN_EXPR type=kotlin.Function0<kotlin.Int> origin=LAMBDA
|
||||||
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Int
|
FUN LOCAL_FUNCTION_FOR_LAMBDA name:<anonymous> visibility:local modality:FINAL <> () returnType:kotlin.Int
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CONST Int type=kotlin.Function0<kotlin.Int> value=42
|
CONST Int type=kotlin.Int value=42
|
||||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:kotlin.Function0<kotlin.Int>
|
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:kotlin.Function0<kotlin.Int>
|
||||||
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val]
|
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val]
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
|
|||||||
Reference in New Issue
Block a user