FIR: resolve annotations on value & type parameters

This commit is contained in:
Mikhail Glukhikh
2018-04-03 22:08:22 +03:00
parent 78d45f3f90
commit e2cec9125d
6 changed files with 15 additions and 7 deletions
@@ -29,9 +29,8 @@ abstract class FirAbstractMemberDeclaration(
final override val typeParameters = mutableListOf<FirTypeParameter>()
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirElement {
annotations.transformInplace(transformer, data)
typeParameters.transformInplace(transformer, data)
return this
return super<FirAbstractNamedAnnotatedDeclaration>.transformChildren(transformer, data)
}
}
@@ -6,12 +6,21 @@
package org.jetbrains.kotlin.fir.declarations.impl
import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.fir.FirElement
import org.jetbrains.kotlin.fir.FirSession
import org.jetbrains.kotlin.fir.declarations.FirNamedDeclaration
import org.jetbrains.kotlin.fir.transformInplace
import org.jetbrains.kotlin.fir.visitors.FirTransformer
import org.jetbrains.kotlin.name.Name
abstract class FirAbstractNamedAnnotatedDeclaration(
session: FirSession,
psi: PsiElement?,
final override val name: Name
) : FirAbstractAnnotatedDeclaration(session, psi), FirNamedDeclaration
) : FirAbstractAnnotatedDeclaration(session, psi), FirNamedDeclaration {
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirElement {
annotations.transformInplace(transformer, data)
return this
}
}
@@ -31,7 +31,7 @@ class FirDefaultSetterValueParameter(
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirElement {
returnType = returnType.transformSingle(transformer, data)
return this
return super<FirAbstractNamedAnnotatedDeclaration>.transformChildren(transformer, data)
}
companion object {
@@ -33,6 +33,6 @@ class FirTypeParameterImpl(
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirElement {
bounds.transformInplace(transformer, data)
return this
return super<FirAbstractNamedAnnotatedDeclaration>.transformChildren(transformer, data)
}
}
@@ -29,6 +29,6 @@ class FirValueParameterImpl(
override fun <D> transformChildren(transformer: FirTransformer<D>, data: D): FirElement {
returnType = returnType.transformSingle(transformer, data)
return this
return super<FirAbstractNamedAnnotatedDeclaration>.transformChildren(transformer, data)
}
}
+1 -1
View File
@@ -1,7 +1,7 @@
FILE: Annotations.kt
@FILE:R|annotations/Simple|()
@R|annotations/WithInt|(STUB) public? abstract class First {
@R|annotations/Simple|() public? abstract function foo(@WithString(STUB) arg: @R|annotations/Simple|() R|kotlin/Double|): R|error: Not supported: FirImplicitTypeImpl|
@R|annotations/Simple|() public? abstract function foo(@R|annotations/WithString|(STUB) arg: @R|annotations/Simple|() R|kotlin/Double|): R|error: Not supported: FirImplicitTypeImpl|
@R|annotations/Complex|(STUB, STUB) public? abstract property v(val): R|kotlin/String|
public? get(): R|kotlin/String|