From 321a19a247ec09bfc351a0bda768313735781a49 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 12 Oct 2016 20:15:53 +0300 Subject: [PATCH] Make JvmPlatform.defaultImports a stored property It was incorrectly made a getter-only property in 2f616bdd --- .../resolve/jvm/platform/JvmPlatform.kt | 40 +++++++++---------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/platform/JvmPlatform.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/platform/JvmPlatform.kt index b800d8deeee..4a8bd15999a 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/platform/JvmPlatform.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/platform/JvmPlatform.kt @@ -26,31 +26,29 @@ import org.jetbrains.kotlin.resolve.scopes.MemberScope import java.util.* object JvmPlatform : TargetPlatform("JVM") { - override val defaultImports: List - get() = ArrayList().apply { - add(ImportPath("java.lang.*")) - add(ImportPath("kotlin.*")) - add(ImportPath("kotlin.annotation.*")) - add(ImportPath("kotlin.jvm.*")) - add(ImportPath("kotlin.collections.*")) - add(ImportPath("kotlin.coroutines.*")) - add(ImportPath("kotlin.ranges.*")) - add(ImportPath("kotlin.sequences.*")) - add(ImportPath("kotlin.text.*")) - add(ImportPath("kotlin.io.*")) + override val defaultImports: List = ArrayList().apply { + add(ImportPath("java.lang.*")) + add(ImportPath("kotlin.*")) + add(ImportPath("kotlin.annotation.*")) + add(ImportPath("kotlin.jvm.*")) + add(ImportPath("kotlin.collections.*")) + add(ImportPath("kotlin.coroutines.*")) + add(ImportPath("kotlin.ranges.*")) + add(ImportPath("kotlin.sequences.*")) + add(ImportPath("kotlin.text.*")) + add(ImportPath("kotlin.io.*")) - fun addAllClassifiersFromScope(scope: MemberScope) { - for (descriptor in scope.getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS, MemberScope.ALL_NAME_FILTER)) { - add(ImportPath(DescriptorUtils.getFqNameSafe(descriptor), false)) - } - } - - val builtIns = DefaultBuiltIns.Instance - for (builtinPackageFragment in builtIns.builtInsPackageFragments) { - addAllClassifiersFromScope(builtinPackageFragment.getMemberScope()) + fun addAllClassifiersFromScope(scope: MemberScope) { + for (descriptor in scope.getContributedDescriptors(DescriptorKindFilter.CLASSIFIERS, MemberScope.ALL_NAME_FILTER)) { + add(ImportPath(DescriptorUtils.getFqNameSafe(descriptor), false)) } } + val builtIns = DefaultBuiltIns.Instance + for (builtinPackageFragment in builtIns.builtInsPackageFragments) { + addAllClassifiersFromScope(builtinPackageFragment.getMemberScope()) + } + } override val platformConfigurator: PlatformConfigurator = JvmPlatformConfigurator }