FIR: forbid supertype resolve in local classes

This commit is contained in:
Mikhail Glukhikh
2019-03-15 18:22:01 +03:00
parent 35c6f09886
commit 0d976a4870
@@ -45,6 +45,18 @@ class FirSupertypeResolverTransformer : FirAbstractTreeTransformer() {
return resolveSupertypesOrExpansions(typeAlias).compose()
}
// This and transformProperty functions are required to forbid supertype resolving for local classes
override fun transformDeclarationWithBody(
declarationWithBody: FirDeclarationWithBody,
data: Nothing?
): CompositeTransformResult<FirDeclaration> {
return declarationWithBody.compose()
}
override fun transformProperty(property: FirProperty, data: Nothing?): CompositeTransformResult<FirDeclaration> {
return property.compose()
}
private fun resolveSupertypesOrExpansions(classLikeDeclaration: FirClassLikeDeclaration): FirDeclaration {
val classId = classLikeDeclaration.symbol.classId