Simplify AnnotationAndConstantLoader, use NameResolver from ProtoContainer
This commit is contained in:
+8
-9
@@ -36,26 +36,26 @@ public class AnnotationLoaderForKotlinJavaScriptStubBuilder() : AnnotationAndCon
|
||||
override fun loadCallableAnnotations(
|
||||
container: ProtoContainer,
|
||||
proto: ProtoBuf.Callable,
|
||||
nameResolver: NameResolver,
|
||||
kind: AnnotatedCallableKind
|
||||
): List<ClassIdWithTarget> {
|
||||
return proto.getExtension(JsProtoBuf.callableAnnotation).orEmpty().map { ClassIdWithTarget(nameResolver.getClassId(it.id), null) }
|
||||
}
|
||||
): List<ClassIdWithTarget> =
|
||||
proto.getExtension(JsProtoBuf.callableAnnotation).orEmpty().map {
|
||||
ClassIdWithTarget(container.nameResolver.getClassId(it.id), null)
|
||||
}
|
||||
|
||||
override fun loadValueParameterAnnotations(
|
||||
container: ProtoContainer,
|
||||
callable: ProtoBuf.Callable,
|
||||
nameResolver: NameResolver,
|
||||
kind: AnnotatedCallableKind,
|
||||
parameterIndex: Int,
|
||||
proto: ProtoBuf.ValueParameter
|
||||
): List<ClassId> =
|
||||
proto.getExtension(JsProtoBuf.parameterAnnotation).orEmpty().map { nameResolver.getClassId(it.id) }
|
||||
proto.getExtension(JsProtoBuf.parameterAnnotation).orEmpty().map {
|
||||
container.nameResolver.getClassId(it.id)
|
||||
}
|
||||
|
||||
override fun loadExtensionReceiverParameterAnnotations(
|
||||
container: ProtoContainer,
|
||||
callable: ProtoBuf.Callable,
|
||||
nameResolver: NameResolver,
|
||||
kind: AnnotatedCallableKind
|
||||
): List<ClassId> = emptyList()
|
||||
|
||||
@@ -68,7 +68,6 @@ public class AnnotationLoaderForKotlinJavaScriptStubBuilder() : AnnotationAndCon
|
||||
override fun loadPropertyConstant(
|
||||
container: ProtoContainer,
|
||||
proto: ProtoBuf.Callable,
|
||||
nameResolver: NameResolver,
|
||||
expectedType: JetType
|
||||
): Unit {}
|
||||
) {}
|
||||
}
|
||||
|
||||
+1
-1
@@ -110,7 +110,7 @@ private class CallableClsStubBuilder(
|
||||
)
|
||||
|
||||
val kind = callableProto.annotatedCallableKind
|
||||
val annotationIds = c.components.annotationLoader.loadCallableAnnotations(protoContainer, callableProto, c.nameResolver, kind)
|
||||
val annotationIds = c.components.annotationLoader.loadCallableAnnotations(protoContainer, callableProto, kind)
|
||||
createTargetedAnnotationStubs(annotationIds, modifierListStubImpl)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -157,7 +157,7 @@ class TypeClsStubBuilder(private val c: ClsStubBuilderContext) {
|
||||
val isVararg = valueParameterProto.hasVarargElementType()
|
||||
val modifierList = if (isVararg) createModifierListStub(parameterStub, listOf(JetTokens.VARARG_KEYWORD)) else null
|
||||
val parameterAnnotations = c.components.annotationLoader.loadValueParameterAnnotations(
|
||||
container, callableProto, c.nameResolver, callableProto.annotatedCallableKind, index, valueParameterProto
|
||||
container, callableProto, callableProto.annotatedCallableKind, index, valueParameterProto
|
||||
)
|
||||
if (parameterAnnotations.isNotEmpty()) {
|
||||
createAnnotationStubs(parameterAnnotations, modifierList ?: createEmptyModifierList(parameterStub))
|
||||
|
||||
Reference in New Issue
Block a user