diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/TargetPlatform.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/TargetPlatform.kt index 269c5ff06c1..5678bbc6a55 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/TargetPlatform.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/TargetPlatform.kt @@ -16,6 +16,7 @@ package org.jetbrains.kotlin.resolve +import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.container.StorageComponentContainer import org.jetbrains.kotlin.container.useInstance import org.jetbrains.kotlin.resolve.calls.checkers.* @@ -32,6 +33,7 @@ public abstract class TargetPlatform( } public abstract val platformConfigurator: PlatformConfigurator + public val builtIns: KotlinBuiltIns = KotlinBuiltIns.getInstance() public object Default : TargetPlatform("Default") { override val platformConfigurator = PlatformConfigurator(DynamicTypesSettings(), listOf(), listOf(), listOf(), listOf(), listOf()) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/project/Platform.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/project/Platform.kt new file mode 100644 index 00000000000..1397faa9bf8 --- /dev/null +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/project/Platform.kt @@ -0,0 +1,23 @@ +/* + * Copyright 2010-2015 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.idea.project + +import org.jetbrains.kotlin.psi.JetElement +import org.jetbrains.kotlin.resolve.TargetPlatform + +val JetElement.platform: TargetPlatform + get() = TargetPlatformDetector.getPlatform(getContainingJetFile()) \ No newline at end of file