Migrate kotlin sources, maven projects and stdlib to new lambda syntax
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@ public class LazyJavaPackageFragmentProvider(
|
||||
}
|
||||
|
||||
private val topLevelClasses = c.storageManager.createMemoizedFunctionWithNullableValues @lambda {
|
||||
(jClass: JavaClass): LazyJavaClassDescriptor? ->
|
||||
jClass: JavaClass ->
|
||||
val fqName = jClass.getFqName()
|
||||
if (fqName == null) return@lambda null
|
||||
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ class LazyJavaAnnotations(
|
||||
private val extraLookup: (FqName) -> JavaAnnotation? = { null }
|
||||
) : Annotations {
|
||||
private val annotationDescriptors = c.storageManager.createMemoizedFunctionWithNullableValues {
|
||||
(annotation: JavaAnnotation) ->
|
||||
annotation: JavaAnnotation ->
|
||||
c.resolveAnnotation(annotation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ class LazyJavaAnnotationDescriptor(
|
||||
javaAnnotation.getClassId()?.asSingleFqName()
|
||||
}
|
||||
|
||||
private val type = c.storageManager.createLazyValue {(): JetType ->
|
||||
private val type = c.storageManager.createLazyValue {
|
||||
val fqName = fqName()
|
||||
if (fqName == null) return@createLazyValue ErrorUtils.createErrorType("No fqName: $javaAnnotation")
|
||||
val annotationClass = JavaToKotlinClassMap.INSTANCE.mapKotlinClass(fqName, TypeUsage.MEMBER_SIGNATURE_INVARIANT)
|
||||
|
||||
+1
-1
@@ -208,7 +208,7 @@ public class LazyJavaClassMemberScope(
|
||||
}
|
||||
|
||||
private val nestedClasses = c.storageManager.createMemoizedFunctionWithNullableValues {
|
||||
(name: Name) ->
|
||||
name: Name ->
|
||||
val jNestedClass = nestedClassIndex()[name]
|
||||
if (jNestedClass == null) {
|
||||
val field = enumEntryIndex()[name]
|
||||
|
||||
+3
-4
@@ -73,9 +73,8 @@ public abstract class LazyJavaMemberScope(
|
||||
|
||||
protected abstract fun getDispatchReceiverParameter(): ReceiverParameterDescriptor?
|
||||
|
||||
private val functions = c.storageManager.createMemoizedFunction {
|
||||
(name: Name): Collection<FunctionDescriptor>
|
||||
->
|
||||
private val functions = c.storageManager.createMemoizedFunction<Name, List<FunctionDescriptor>> {
|
||||
name ->
|
||||
val result = LinkedHashSet<SimpleFunctionDescriptor>()
|
||||
|
||||
for (method in memberIndex().findMethodsByName(name)) {
|
||||
@@ -222,7 +221,7 @@ public abstract class LazyJavaMemberScope(
|
||||
protected abstract fun getPropertyNames(kindFilter: DescriptorKindFilter, nameFilter: (Name) -> Boolean): Collection<Name>
|
||||
|
||||
private val properties = c.storageManager.createMemoizedFunction {
|
||||
(name: Name) ->
|
||||
name: Name ->
|
||||
val properties = ArrayList<PropertyDescriptor>()
|
||||
|
||||
val field = memberIndex().findFieldByName(name)
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ object EMPTY_MEMBER_INDEX : MemberIndex {
|
||||
|
||||
open class ClassMemberIndex(val jClass: JavaClass, val memberFilter: (JavaMember) -> Boolean) : MemberIndex {
|
||||
private val methodFilter = {
|
||||
(m: JavaMethod) ->
|
||||
m: JavaMethod ->
|
||||
memberFilter(m) && !DescriptorResolverUtils.isObjectMethodInInterface(m)
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -65,7 +65,7 @@ class LazyJavaTypeResolver(
|
||||
}
|
||||
|
||||
public fun transformArrayType(arrayType: JavaArrayType, attr: JavaTypeAttributes, isVararg: Boolean = false): JetType {
|
||||
return run { (): JetType ->
|
||||
return run {
|
||||
val javaComponentType = arrayType.getComponentType()
|
||||
if (javaComponentType is JavaPrimitiveType) {
|
||||
val jetType = JavaToKotlinClassMap.INSTANCE.mapPrimitiveKotlinClass("[" + javaComponentType.getCanonicalText())
|
||||
@@ -248,7 +248,6 @@ class LazyJavaTypeResolver(
|
||||
}
|
||||
|
||||
private val nullable = c.storageManager.createLazyValue @l {
|
||||
(): Boolean ->
|
||||
when (attr.flexibility) {
|
||||
FLEXIBLE_LOWER_BOUND -> return@l false
|
||||
FLEXIBLE_UPPER_BOUND -> return@l true
|
||||
|
||||
Reference in New Issue
Block a user