Forbid manipulations with FirWrappedArgumentExpression type reference

The type of this expression is bound to the type of wrapped expression,
so it's better not to change it directly.
This commit is contained in:
Mikhail Glukhikh
2019-06-10 12:34:55 +03:00
parent b7da2f2ad8
commit b71de954ff
5 changed files with 11 additions and 22 deletions
@@ -937,7 +937,7 @@ open class FirBodyResolveTransformer(val session: FirSession, val implicitTypeOn
}
override fun transformExpression(expression: FirExpression, data: Any?): CompositeTransformResult<FirStatement> {
if (expression.resultType is FirImplicitTypeRef) {
if (expression.resultType is FirImplicitTypeRef && expression !is FirWrappedArgumentExpression) {
val type = FirErrorTypeRefImpl(session, expression.psi, "Type calculating for ${expression::class} is not supported")
expression.resultType = type
}