Compare commits

...

27 Commits

Author SHA1 Message Date
Stanislav Erokhin
3927c2e1e1 KT-9461: Inference failed: type parameter fixed early
#KT-9461 Fixed
(cherry picked from commit 77ce125)
2015-10-05 17:22:50 +03:00
Dmitry Jemerov
83fed7b481 advance until-build to branch 144
(cherry picked from commit 2109a6b)
2015-09-30 15:42:31 +02:00
Nikolay Krasko
b10cf7d712 Fix test data in M14 (they were muted at the moment of release) 2015-09-30 16:02:04 +03:00
Nikolay Krasko
24edf91534 Enable bootstrapping and version replacement for M14 2015-09-30 16:01:28 +03:00
Ilya Gorbunov
6e1d7d824f Correct replacement for platformName annotation. 2015-09-29 23:00:12 +03:00
Nikolay Krasko
15b4887095 Update since to 142.5047.6 2015-09-29 15:46:13 +03:00
Ilya Gorbunov
de7262ae68 Mark CharSequence.iterator() with operator. 2015-09-28 21:57:28 +03:00
Nikolay Krasko
3c393282cd Fix typo in extension 2015-09-28 16:02:29 +03:00
Dmitry Jemerov
daa2618146 change expected output according to changes in output due to PERF removal 2015-09-28 14:59:54 +02:00
Dmitry Kovanikov
b322636064 Minor: rename Kotlin console... action name to Kotlin REPL 2015-09-28 15:52:15 +03:00
Dmitry Kovanikov
f2c13980d1 Add icon to Kotlin console... action 2015-09-28 15:52:14 +03:00
Dmitry Kovanikov
5788d54521 KT-9262: don't show warning about non-existent location after typing ':quit' 2015-09-28 15:52:13 +03:00
Dmitry Kovanikov
9a037c1254 KT-9263: don't show error message when user tries to execute command in non-existed REPL console 2015-09-28 15:52:13 +03:00
Dmitry Kovanikov
d69bba12e9 KT-9249: show text representation of first shortcut inside repl placeholder 2015-09-28 15:52:12 +03:00
Dmitry Jemerov
a2b346f6ee dependency on java-i18n plugin
(cherry picked from commit 93e2827)
2015-09-28 14:49:56 +02:00
Mikhail Glukhikh
4203677824 ReplaceWith now functions correctly in built-ins #KT-9351 Fixed 2015-09-28 15:41:34 +03:00
Dmitry Jemerov
0d5e7a0cfc fix 'operator' modifier inspection
#KT-9349 Fixed
(cherry picked from commit ee1175d)
2015-09-28 14:40:18 +02:00
Dmitry Jemerov
183328efe7 fix expected output that changed due to perf removal 2015-09-28 13:28:35 +02:00
Dmitry Jemerov
b1c87bab9e disable perf output by default (M13 only) 2015-09-28 13:28:15 +02:00
Nikolay Krasko
7a1135d715 Suppress warning in proguard about jna classes 2015-09-28 09:08:39 +03:00
Nikolay Krasko
17eead516c Update to IDEA 142.5047.6 2015-09-28 09:08:38 +03:00
Natalia Ukhorskaya
f0a4b4ed32 Add missing readAction 2015-09-28 09:08:38 +03:00
Natalia Ukhorskaya
0c520c5d65 jna-util.jar was renamed to jna-platform.jar 2015-09-28 09:08:37 +03:00
Natalia Ukhorskaya
61881ea3a8 Fix compilation errors 2015-09-28 09:08:37 +03:00
Natalia Ukhorskaya
735a690c60 Rewrite DebuggerTests (do not use FrameTree) 2015-09-28 09:08:36 +03:00
Michael Nedzelsky
58fa2d3b53 get rid of internal JvmVersion annotation in kotlin-jdbc 2015-09-27 20:38:42 +03:00
Michael Nedzelsky
a00b390282 fix check for internal from another module in imports and file level annotations 2015-09-27 20:38:38 +03:00
58 changed files with 299 additions and 124 deletions

View File

@@ -482,7 +482,7 @@
<zipgroupfileset dir="${basedir}/lib" includes="*.jar"/>
<zipgroupfileset dir="${basedir}/ideaSDK/core" includes="*.jar" excludes="util.jar"/>
<zipfileset src="${idea.sdk}/lib/jna-utils.jar"/>
<zipfileset src="${idea.sdk}/lib/jna-platform.jar"/>
<zipfileset src="${idea.sdk}/lib/oromatcher.jar"/>
<zipfileset src="${idea.sdk}/jps/jps-model.jar"/>
<zipfileset src="${dependencies.dir}/jline.jar"/>

View File

@@ -26,6 +26,8 @@ public class CLIConfigurationKeys {
CompilerConfigurationKey.create("message collector");
public static final CompilerConfigurationKey<List<CompilerPlugin>> COMPILER_PLUGINS =
CompilerConfigurationKey.create("compiler plugins");
public static final CompilerConfigurationKey<Boolean> REPORT_PERF =
CompilerConfigurationKey.create("enable perf");
private CLIConfigurationKeys() {
}

View File

@@ -17,12 +17,14 @@
package org.jetbrains.kotlin.cli.common
import com.intellij.openapi.Disposable
import com.intellij.openapi.project.Project
import org.jetbrains.kotlin.cli.common.modules.ModuleXmlParser
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.load.kotlin.ModuleVisibilityManager
import org.jetbrains.kotlin.load.kotlin.getSourceElement
import org.jetbrains.kotlin.load.kotlin.isContainedByCompiledPartOfOurModule
import org.jetbrains.kotlin.modules.Module
import org.jetbrains.kotlin.resolve.lazy.descriptors.LazyPackageDescriptor
import org.jetbrains.kotlin.resolve.source.KotlinSourceElement
import org.jetbrains.kotlin.util.ModuleVisibilityHelper
import java.io.File
@@ -31,13 +33,15 @@ class ModuleVisibilityHelperImpl : ModuleVisibilityHelper {
override fun isInFriendModule(what: DeclarationDescriptor, from: DeclarationDescriptor): Boolean {
val fromSource = getSourceElement(from)
// We only interested in case when fromSource is KotlinSourceElement,
// because at this point
// We should check accessibility of 'from' in current module (some set of source files, which are compiled together),
// so we can assume that 'from' should have sources.
if (fromSource !is KotlinSourceElement) return true
// so we can assume that 'from' should have sources or is a LazyPackageDescriptor with some package files.
val project: Project = if (fromSource is KotlinSourceElement) {
fromSource.psi.project
}
else {
(from as? LazyPackageDescriptor)?.declarationProvider?.getPackageFiles()?.firstOrNull()?.project ?: return true
}
val project = fromSource.psi.project
val moduleVisibilityManager = ModuleVisibilityManager.SERVICE.getInstance(project)
val whatSource = getSourceElement(what)

View File

@@ -64,6 +64,7 @@ public open class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
val configuration = CompilerConfiguration()
configuration.put(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, messageSeverityCollector)
configuration.put(CLIConfigurationKeys.REPORT_PERF, arguments.reportPerf)
if (IncrementalCompilation.isEnabled()) {
val incrementalCompilationComponents = services.get(javaClass<IncrementalCompilationComponents>())
@@ -248,8 +249,10 @@ public open class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
}
public fun reportPerf(configuration: CompilerConfiguration, message: String) {
val collector = configuration[CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY]!!
collector.report(CompilerMessageSeverity.INFO, "PERF: " + message, CompilerMessageLocation.NO_LOCATION)
if (configuration[CLIConfigurationKeys.REPORT_PERF] == true) {
val collector = configuration[CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY]!!
collector.report(CompilerMessageSeverity.INFO, "PERF: " + message, CompilerMessageLocation.NO_LOCATION)
}
}
fun reportGCTime(configuration: CompilerConfiguration) {

View File

@@ -33,6 +33,8 @@ messages/**)
-dontwarn com.intellij.util.SnappyInitializer
-dontwarn net.sf.cglib.**
-dontwarn org.objectweb.asm.** # this is ASM3, the old version that we do not use
-dontwarn com.sun.jna.NativeString
-dontwarn com.sun.jna.WString
-libraryjars '<rtjar>'
-libraryjars '<jssejar>'

View File

@@ -261,7 +261,7 @@ class GenericCandidateResolver(
return
}
}
val expectedTypeWithoutReturnType = if (hasExpectedReturnType) replaceReturnTypeByUnknown(expectedType) else expectedType
val expectedTypeWithoutReturnType = replaceReturnTypeByUnknown(expectedType)
val newContext = context.replaceExpectedType(expectedTypeWithoutReturnType).replaceDataFlowInfo(dataFlowInfoForArgument)
.replaceContextDependency(INDEPENDENT)
val type = argumentTypeResolver.getFunctionLiteralTypeInfo(argumentExpression, functionLiteral, newContext, RESOLVE_FUNCTION_ARGUMENTS).type

View File

@@ -1,7 +1,7 @@
error: supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class test.Sub, unresolved supertypes: Super
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInJava/source.kt:5:22: error: unresolved reference: foo
fun bar() = SubSub().foo()
^
COMPILATION_ERROR
error: supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class test.Sub, unresolved supertypes: Super
COMPILATION_ERROR

View File

@@ -1,7 +1,7 @@
error: supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class test.Sub, unresolved supertypes: test.Super
compiler/testData/compileKotlinAgainstCustomBinaries/incompleteHierarchyInKotlin/source.kt:5:22: error: unresolved reference: foo
fun bar() = SubSub().foo()
^
COMPILATION_ERROR
error: supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
class test.Sub, unresolved supertypes: test.Super
COMPILATION_ERROR

View File

@@ -8,5 +8,5 @@ public annotation class FileAnn
// FILE: 1.kt
<!WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET!>@file:ClassAnn<!>
// FILE: 2.kr
// FILE: 2.kt
@file:FileAnn

View File

@@ -0,0 +1,17 @@
interface In<in I>
interface B : In<B>
interface C<I, T>
fun <I, T> In<I>.foo(<!UNUSED_PARAMETER!>f<!>: () -> C<I, T>) {}
fun <I, T, Self: In<I>> Self.foo2(<!UNUSED_PARAMETER!>f<!>: () -> C<I, T>) {}
class E : B // e <: In<B> <: In<E>
fun test(c: C<E, Int>, e: E) {
e.foo<E, Int> { c }
e.foo { c } // error here: expected C<B, ???> but must be C<??? : B, ???>
e.foo2 { c }
e.foo2 ({ c })
}

View File

@@ -0,0 +1,30 @@
package
public fun test(/*0*/ c: C<E, kotlin.Int>, /*1*/ e: E): kotlin.Unit
public fun </*0*/ I, /*1*/ T> In<I>.foo(/*0*/ f: () -> C<I, T>): kotlin.Unit
public fun </*0*/ I, /*1*/ T, /*2*/ Self : In<I>> Self.foo2(/*0*/ f: () -> C<I, T>): kotlin.Unit
public interface B : In<B> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface C</*0*/ I, /*1*/ T> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class E : B {
public constructor E()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public interface In</*0*/ in I> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}

View File

@@ -7808,6 +7808,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("kt9461.kt")
public void testKt9461() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inference/regressions/kt9461.kt");
doTest(fileName);
}
@TestMetadata("kt948.kt")
public void testKt948() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/inference/regressions/kt948.kt");

View File

@@ -1,3 +1,4 @@
fun<T> foo(t<caret>)
// ELEMENT: t
// TODO_ELEMENT: t
// ELEMENT: thread

View File

@@ -1,3 +1,4 @@
fun<T> foo(t: T<caret>)
fun<T> foo(thread: Thread)
// ELEMENT: t
// TODO_ELEMENT: t
// ELEMENT: thread

View File

@@ -27,6 +27,7 @@ import com.intellij.execution.process.ProcessAdapter
import com.intellij.execution.process.ProcessEvent
import com.intellij.execution.runners.AbstractConsoleRunnerWithHistory
import com.intellij.execution.ui.RunContentDescriptor
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.actionSystem.AnAction
import com.intellij.openapi.actionSystem.CommonShortcuts
import com.intellij.openapi.actionSystem.DefaultActionGroup
@@ -37,6 +38,7 @@ import com.intellij.openapi.editor.markup.HighlighterLayer
import com.intellij.openapi.editor.markup.HighlighterTargetArea
import com.intellij.openapi.editor.markup.RangeHighlighter
import com.intellij.openapi.editor.markup.TextAttributes
import com.intellij.openapi.keymap.KeymapUtil
import com.intellij.openapi.module.Module
import com.intellij.openapi.project.Project
import com.intellij.openapi.util.Disposer
@@ -58,6 +60,8 @@ import java.awt.Color
import java.awt.Font
import kotlin.properties.Delegates
private val KOTLIN_SHELL_EXECUTE_ACTION_ID = "KotlinShellExecute"
public class KotlinConsoleRunner(
val module: Module,
private val cmdLine: GeneralCommandLine,
@@ -139,12 +143,15 @@ public class KotlinConsoleRunner(
}
override fun createConsoleExecAction(consoleExecuteActionHandler: ProcessBackedConsoleExecuteActionHandler)
= ConsoleExecuteAction(consoleView, consoleExecuteActionHandler, "KotlinShellExecute", consoleExecuteActionHandler)
= ConsoleExecuteAction(consoleView, consoleExecuteActionHandler, KOTLIN_SHELL_EXECUTE_ACTION_ID, consoleExecuteActionHandler)
override fun constructConsoleTitle(title: String) = "$title (in module ${module.name})"
private fun setupPlaceholder(editor: EditorEx) {
editor.setPlaceholder("<Ctrl+Enter> to execute")
val executeCommandAction = ActionManager.getInstance().getAction(KOTLIN_SHELL_EXECUTE_ACTION_ID)
val executeCommandActionShortcutText = KeymapUtil.getFirstKeyboardShortcutText(executeCommandAction)
editor.setPlaceholder("<$executeCommandActionShortcutText> to execute")
editor.setShowPlaceholderWhenFocused(true)
val placeholderAttrs = TextAttributes()

View File

@@ -49,6 +49,9 @@ public class KotlinReplOutputHandler(
override fun isSilentlyDestroyOnClose() = true
override fun notifyTextAvailable(text: String, key: Key<*>?) {
// hide warning about adding test folder to classpath
if (text.startsWith("warning: classpath entry points to a non-existent location")) return
// skip "/usr/lib/jvm/java-8-oracle/bin/java -cp ..." intro
if (!text.startsWith(XML_PREFIX)) return super.notifyTextAvailable(text, key)

View File

@@ -47,8 +47,7 @@ public class RunKotlinConsoleAction : AnAction() {
public class KtExecuteCommandAction(private val consoleFile: VirtualFile) : AnAction() {
override fun actionPerformed(e: AnActionEvent) {
val project = e.project ?: return errorNotification(null, "Cannot find project")
val ktConsole = KotlinConsoleKeeper.getInstance(project).getConsoleByVirtualFile(consoleFile)
?: return errorNotification(project, "Action performed in an invalid console")
val ktConsole = KotlinConsoleKeeper.getInstance(project).getConsoleByVirtualFile(consoleFile) ?: return
ktConsole.executor.executeCommand()
}

View File

@@ -0,0 +1,12 @@
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<psi.referenceContributor language="jet" implementation="org.jetbrains.kotlin.idea.properties.KotlinPropertiesReferenceContributor"/>
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.KotlinInvalidBundleOrPropertyInspection"
displayName="Invalid property key"
groupName="Kotlin"
enabledByDefault="true"
level="ERROR"
/>
</extensions>
</idea-plugin>

View File

@@ -6,7 +6,7 @@
<version>@snapshot@</version>
<vendor url="http://www.jetbrains.com">JetBrains s.r.o.</vendor>
<idea-version since-build="142.4465.2" until-build="142.9999"/>
<idea-version since-build="142.5047.6" until-build="144.9999"/>
<depends optional="true" config-file="junit.xml">JUnit</depends>
<depends optional="true" config-file="gradle.xml">org.jetbrains.plugins.gradle</depends>
@@ -16,6 +16,7 @@
<depends optional="true" config-file="javaScriptDebug.xml">JavaScriptDebugger</depends>
<depends optional="true" config-file="android.xml">org.jetbrains.android</depends>
<depends optional="true" config-file="coverage.xml">Coverage</depends>
<depends optional="true" config-file="i18n.xml">com.intellij.java-i18n</depends>
<project-components>
<component>
@@ -150,7 +151,8 @@
<!-- Kotlin Console REPL-->
<action id="KotlinConsoleREPL" class="org.jetbrains.kotlin.console.actions.RunKotlinConsoleAction"
text="Kotlin console...">
text="Kotlin REPL"
icon="/org/jetbrains/kotlin/idea/icons/kotlin_launch_configuration.png">
<add-to-group group-id="KotlinToolsGroup" anchor="last"/>
</action>
@@ -361,7 +363,6 @@
<weigher key="completion" implementationClass="org.jetbrains.kotlin.idea.completion.KotlinLookupElementProximityWeigher" id="kotlin.proximity" order="after proximity"/>
<psi.referenceContributor language="jet" implementation="org.jetbrains.kotlin.idea.references.JetReferenceContributor"/>
<psi.referenceContributor language="jet" implementation="org.jetbrains.kotlin.idea.properties.KotlinPropertiesReferenceContributor"/>
<renamePsiElementProcessor id="KotlinClass"
implementation="org.jetbrains.kotlin.idea.refactoring.rename.RenameKotlinClassProcessor"
@@ -1221,13 +1222,6 @@
cleanupTool="true"
level="WARNING"/>
<localInspection implementationClass="org.jetbrains.kotlin.idea.inspections.KotlinInvalidBundleOrPropertyInspection"
displayName="Invalid property key"
groupName="Kotlin"
enabledByDefault="true"
level="ERROR"
/>
<referenceImporter implementation="org.jetbrains.kotlin.idea.quickfix.KotlinReferenceImporter"/>
<fileType.fileViewProviderFactory filetype="KJSM" implementationClass="com.intellij.psi.ClassFileViewProviderFactory"/>

View File

@@ -192,7 +192,7 @@ class KotlinEvaluator(val codeFragment: JetCodeFragment,
.filter { it.relativePath != "$packageInternalName.class" }
.sortBy { it.relativePath.length() }
val funName = extractedFunction.name
val funName = runReadAction { extractedFunction.name }
if (funName == null) {
throw IllegalStateException("Extracted function should have a name: ${extractedFunction.text}")
}

View File

@@ -74,12 +74,13 @@ public class KotlinCallHierarchyNodeDescriptor extends HierarchyNodeDescriptor i
}
public final PsiElement getTargetElement(){
return myElement;
return getPsiElement();
}
@Override
public final boolean isValid(){
//noinspection ConstantConditions
PsiElement myElement = getPsiElement();
return myElement != null && myElement.isValid();
}

View File

@@ -24,19 +24,20 @@ import com.intellij.codeInspection.ProblemsHolder
import com.intellij.openapi.project.Project
import com.intellij.psi.PsiElementVisitor
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
import org.jetbrains.kotlin.diagnostics.Diagnostic
import org.jetbrains.kotlin.diagnostics.DiagnosticWithParameters2
import org.jetbrains.kotlin.idea.caches.resolve.analyze
import org.jetbrains.kotlin.idea.quickfix.AddModifierFix
import org.jetbrains.kotlin.idea.quickfix.CleanupFix
import org.jetbrains.kotlin.idea.quickfix.JetSingleIntentionActionFactory
import org.jetbrains.kotlin.idea.search.usagesSearch.descriptor
import org.jetbrains.kotlin.lexer.JetTokens
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.getNonStrictParentOfType
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
import org.jetbrains.kotlin.resolve.OverrideResolver
import org.jetbrains.kotlin.resolve.dataClassUtils.isComponentLike
import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode
import org.jetbrains.kotlin.resolve.source.PsiSourceElement
import org.jetbrains.kotlin.types.expressions.OperatorConventions
@@ -48,12 +49,13 @@ public class OperatorModifierInspection : AbstractKotlinInspection() {
if (nameIdentifier != null &&
function.isMemberOrExtension() &&
function.isOperator() &&
!function.hasModifier(JetTokens.OPERATOR_KEYWORD)) {
!function.isAnnotatedAsOperator()) {
holder.registerProblem(nameIdentifier, "Function defines an operator but isn't annotated as such",
AddModifierLocalQuickFix())
}
}
}
}
@@ -86,15 +88,25 @@ public class OperatorModifierInspection : AbstractKotlinInspection() {
return false
}
private fun JetNamedFunction.isAnnotatedAsOperator(): Boolean {
if (hasModifier(JetTokens.OPERATOR_KEYWORD)) return true
val descriptor = descriptor as? CallableMemberDescriptor ?: return false
return OverrideResolver.getOverriddenDeclarations(descriptor).any {
(it as? FunctionDescriptor)?.isOperator == true
}
}
private fun JetNamedFunction.isMemberOrExtension(): Boolean =
receiverTypeReference != null || getStrictParentOfType<JetClassOrObject>() != null
private fun JetNamedFunction.isIntReturnType(): Boolean {
return KotlinBuiltIns.isInt(analyze(BodyResolveMode.PARTIAL).getType(this) ?: return false)
val returnType = (descriptor as? FunctionDescriptor)?.returnType ?: return false
return KotlinBuiltIns.isInt(returnType)
}
private fun JetNamedFunction.isBooleanReturnType(): Boolean {
return KotlinBuiltIns.isBoolean(analyze(BodyResolveMode.PARTIAL).getType(this) ?: return false)
val returnType = (descriptor as? FunctionDescriptor)?.returnType ?: return false
return KotlinBuiltIns.isBoolean(returnType)
}
}

View File

@@ -222,8 +222,14 @@ object ReplaceWithAnnotationAnalyzer {
resolutionFacade: ResolutionFacade
): BindingContext {
val traceContext = BindingTraceContext()
resolutionFacade.getFrontendService(module, ExpressionTypingServices::class.java)
.getTypeInfo(scope, expression, TypeUtils.NO_EXPECTED_TYPE, DataFlowInfo.EMPTY, traceContext, false)
val frontendService = if (module.builtIns.builtInsModule == module) {
// TODO: doubtful place, do we require this module or not? Built-ins module doesn't have some necessary components...
resolutionFacade.getFrontendService(ExpressionTypingServices::class.java)
}
else {
resolutionFacade.getFrontendService(module, ExpressionTypingServices::class.java)
}
frontendService.getTypeInfo(scope, expression, TypeUtils.NO_EXPECTED_TYPE, DataFlowInfo.EMPTY, traceContext, false)
return traceContext.bindingContext
}

View File

@@ -27,7 +27,6 @@ class MyDelegateThrowsException {
// PRINT_FRAME
frame = main():8, DelegatedPropertyInClassKt {delegatedPropertyInClass}
static = static = delegatedPropertyInClass.DelegatedPropertyInClassKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClass.kt, 5)
local = a: delegatedPropertyInClass.A = {delegatedPropertyInClass.A@uniqueID} (sp = delegatedPropertyInClass.kt, 6)
field = prop$delegate: delegatedPropertyInClass.MyDelegate = {delegatedPropertyInClass.MyDelegate@uniqueID} (sp = delegatedPropertyInClass.kt, 12)

View File

@@ -23,7 +23,6 @@ class MyDelegate {
// RENDER_DELEGATED_PROPERTIES: false
// PRINT_FRAME
frame = main():8, DelegatedPropertyInClassWoRendererKt {delegatedPropertyInClassWoRenderer}
static = static = delegatedPropertyInClassWoRenderer.DelegatedPropertyInClassWoRendererKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 5)
local = a: delegatedPropertyInClassWoRenderer.A = {delegatedPropertyInClassWoRenderer.A@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 6)
field = prop: int = {delegatedPropertyInClassWoRenderer.MyDelegate@uniqueID} (sp = delegatedPropertyInClassWoRenderer.kt, 12)

View File

@@ -20,8 +20,8 @@ fun main(args: Array<String>) {
}
// PRINT_FRAME
Compile bytecode for a2.prop
frame = main():14, EvBreakpointOnPropertyDeclarationKt {evBreakpointOnPropertyDeclaration}
static = static = evBreakpointOnPropertyDeclaration.EvBreakpointOnPropertyDeclarationKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evBreakpointOnPropertyDeclaration.kt, 7)
local = a1: evBreakpointOnPropertyDeclaration.A = {evBreakpointOnPropertyDeclaration.A@uniqueID} (sp = evBreakpointOnPropertyDeclaration.kt, 8)
field = prop: int = 1 (sp = evBreakpointOnPropertyDeclaration.kt, 4)

View File

@@ -19,7 +19,6 @@ fun main(args: Array<String>) {
// PRINT_FRAME
frame = main():13, EvDelegatedPropertyKt {evDelegatedProperty}
static = static = evDelegatedProperty.EvDelegatedPropertyKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evDelegatedProperty.kt, 9)
local = a: evDelegatedProperty.A = {evDelegatedProperty.A@uniqueID} (sp = evDelegatedProperty.kt, 10)
field = prop$delegate: kotlin.properties.ReadWriteProperty = {kotlin.properties.NotNullVar@uniqueID} (sp = evDelegatedProperty.kt, 6)

View File

@@ -15,8 +15,8 @@ fun main(args: Array<String>) {
}
// PRINT_FRAME
Compile bytecode for a.prop
frame = main():10, EvDuplicateItemsKt {evDuplicateItems}
static = static = evDuplicateItems.EvDuplicateItemsKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evDuplicateItems.kt, 7)
local = a: evDuplicateItems.A = {evDuplicateItems.A@uniqueID} (sp = evDuplicateItems.kt, 8)
field = prop: int = 1 (sp = evDuplicateItems.kt, 4)

View File

@@ -16,7 +16,6 @@ fun main(args: Array<String>) {
// PRINT_FRAME
frame = main():10, EvFinalPropertyKt {evFinalProperty}
static = static = evFinalProperty.EvFinalPropertyKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evFinalProperty.kt, 7)
local = a: evFinalProperty.A = {evFinalProperty.A@uniqueID} (sp = evFinalProperty.kt, 8)
field = prop: int = 1 (sp = evFinalProperty.kt, 4)

View File

@@ -24,8 +24,8 @@ fun main(args: Array<String>) {
fun foo(i: Int) {}
// PRINT_FRAME
Compile bytecode for a2.prop
frame = main():15, EvLineRangeKt {evLineRange}
static = static = evLineRange.EvLineRangeKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evLineRange.kt, 7)
local = a1: evLineRange.A = {evLineRange.A@uniqueID} (sp = evLineRange.kt, 8)
field = prop: int = 1 (sp = evLineRange.kt, 4)

View File

@@ -17,8 +17,8 @@ fun main(args: Array<String>) {
}
// PRINT_FRAME
Compile bytecode for a.prop
frame = main():10, EvPropertyKt {evProperty}
static = static = evProperty.EvPropertyKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evProperty.kt, 7)
local = a: evProperty.A = {evProperty.A@uniqueID} (sp = evProperty.kt, 8)
field = prop: int = 1 (sp = evProperty.kt, 4)

View File

@@ -20,6 +20,7 @@ fun main(args: Array<String>) {
}
// PRINT_FRAME
Compile bytecode for prop
frame = test():8, A {evPropertyRefExpr}
this = this = {evPropertyRefExpr.A@uniqueID}
field = prop: int = 1 (sp = evPropertyRefExpr.kt, 4)

View File

@@ -28,8 +28,8 @@ interface T {
fun foo(i: Int) {}
// PRINT_FRAME
Compile bytecode for a1.prop
frame = main():12, EvSkipAnonymousObjectKt {evSkipAnonymousObject}
static = static = evSkipAnonymousObject.EvSkipAnonymousObjectKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evSkipAnonymousObject.kt, 7)
local = a1: evSkipAnonymousObject.A = {evSkipAnonymousObject.A@uniqueID} (sp = evSkipAnonymousObject.kt, 8)
field = prop: int = 1 (sp = evSkipAnonymousObject.kt, 4)

View File

@@ -23,8 +23,8 @@ fun foo(i: Int) {}
fun l(f: () -> Unit) {}
// PRINT_FRAME
Compile bytecode for a1.prop
frame = main():12, EvSkipLambdaKt {evSkipLambda}
static = static = evSkipLambda.EvSkipLambdaKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evSkipLambda.kt, 7)
local = a1: evSkipLambda.A = {evSkipLambda.A@uniqueID} (sp = evSkipLambda.kt, 8)
field = prop: int = 1 (sp = evSkipLambda.kt, 4)

View File

@@ -24,8 +24,8 @@ fun main(args: Array<String>) {
fun foo(i: Int) {}
// PRINT_FRAME
Compile bytecode for a1.prop
frame = main():12, EvSkipLocalClassKt {evSkipLocalClass}
static = static = evSkipLocalClass.EvSkipLocalClassKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = evSkipLocalClass.kt, 7)
local = a1: evSkipLocalClass.A = {evSkipLocalClass.A@uniqueID} (sp = evSkipLocalClass.kt, 8)
field = prop: int = 1 (sp = evSkipLocalClass.kt, 4)

View File

@@ -15,7 +15,6 @@ fun main(args: Array<String>) {
// RESULT: 1: I
frame = main():6, FrameClosingBracketKt {frameClosingBracket}
static = static = frameClosingBracket.FrameClosingBracketKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameClosingBracket.kt, 3)
local = a: int = 1 (sp = frameClosingBracket.kt, 4)
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'

View File

@@ -28,7 +28,6 @@ fun A.foo() {
// EXPRESSION: myFun()
// RESULT: 1: I
frame = foo():14, FrameExtensionFunKt {frameExtensionFun}
static = static = frameExtensionFun.FrameExtensionFunKt
local = $receiver: frameExtensionFun.A = {frameExtensionFun.A@uniqueID} (sp = null)
field = prop: int = 1 (sp = frameExtensionFun.kt, 8)
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'

View File

@@ -12,7 +12,6 @@ fun main(args: Array<String>) {
// PRINT_FRAME
frame = main():6, FrameLocalVariableKt {frameLocalVariable}
static = static = frameLocalVariable.FrameLocalVariableKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameLocalVariable.kt, 3)
local = val1: int = 1 (sp = frameLocalVariable.kt, 4)
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'

View File

@@ -22,7 +22,6 @@ inline fun foo(f: () -> Unit) {
// EXPRESSION: var1
// RESULT: 1: I
frame = main():7, FrameSharedVarLocalVarKt {frameSharedVarLocalVar}
static = static = frameSharedVarLocalVar.FrameSharedVarLocalVarKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = frameSharedVarLocalVar.kt, 3)
local = var1: kotlin.jvm.internal.Ref$IntRef = {kotlin.jvm.internal.Ref$IntRef@uniqueID}1 (sp = frameSharedVarLocalVar.kt, 4)
field = element: int = 1 (sp = Ref.!EXT!)

View File

@@ -16,7 +16,6 @@ class A {
// PRINT_FRAME
frame = main():6, ToStringRendererKt {toStringRenderer}
static = static = toStringRenderer.ToStringRendererKt
local = args: java.lang.String[] = {java.lang.String[0]@uniqueID} (sp = toStringRenderer.kt, 3)
local = a: toStringRenderer.A = {toStringRenderer.A@uniqueID}myA (sp = toStringRenderer.kt, 4)
- No fields to display

View File

@@ -20,6 +20,7 @@ fun foo() {
val xx = valX
varX = 50
varY = 60
1.identityEquals(2)
}
fun unnecessarySafeCall(x: String) {

View File

@@ -19,6 +19,7 @@ fun foo() {
val xx = valX
varX = 50
varY = 60
1 === 2
}
fun unnecessarySafeCall(x: String) {

View File

@@ -0,0 +1,4 @@
// "Add 'operator' modifier" "true"
class A {
fun <caret>contains(other: A): Boolean = true
}

View File

@@ -0,0 +1,4 @@
// "Add 'operator' modifier" "true"
class A {
operator fun <caret>contains(other: A): Boolean = true
}

View File

@@ -0,0 +1,10 @@
// "Add 'operator' modifier" "false"
// ACTION: Convert to block body
// ACTION: Specify return type explicitly
open class A {
open operator fun plus(a: A) = A()
}
class B : A() {
override fun plu<caret>s(a: A) = A()
}

View File

@@ -34,6 +34,7 @@ import com.intellij.psi.JavaPsiFacade;
import com.intellij.psi.PsiClass;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.testFramework.IdeaTestUtil;
import com.intellij.xdebugger.XDebugSession;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.asJava.FakeLightClassForFileOfPackage;
import org.jetbrains.kotlin.asJava.KotlinLightClassForFacade;
@@ -238,4 +239,12 @@ public abstract class KotlinDebuggerTestCase extends DescriptorTestCase {
e.getActual());
}
}
@Override
public Object getData(String dataId) {
if (XDebugSession.DATA_KEY.is(dataId)) {
return myDebuggerSession == null ? null : myDebuggerSession.getXDebugSession();
}
return super.getData(dataId);
}
}

View File

@@ -17,16 +17,14 @@
package org.jetbrains.kotlin.idea.debugger.evaluate
import com.intellij.debugger.SourcePosition
import com.intellij.debugger.engine.ContextUtil
import com.intellij.debugger.engine.SourcePositionProvider
import com.intellij.debugger.engine.SuspendContextImpl
import com.intellij.debugger.engine.*
import com.intellij.debugger.engine.evaluation.CodeFragmentKind
import com.intellij.debugger.engine.evaluation.EvaluateException
import com.intellij.debugger.engine.evaluation.TextWithImports
import com.intellij.debugger.engine.evaluation.TextWithImportsImpl
import com.intellij.debugger.engine.evaluation.expression.EvaluatorBuilderImpl
import com.intellij.debugger.impl.DescriptorTestCase
import com.intellij.debugger.settings.NodeRendererSettings
import com.intellij.debugger.ui.impl.FrameVariablesTree
import com.intellij.debugger.ui.impl.watch.*
import com.intellij.debugger.ui.tree.FieldDescriptor
import com.intellij.debugger.ui.tree.LocalVariableDescriptor
@@ -36,8 +34,15 @@ import com.intellij.execution.process.ProcessOutputTypes
import com.intellij.openapi.util.Disposer
import com.intellij.openapi.util.io.FileUtil
import com.intellij.psi.PsiElement
import com.intellij.xdebugger.impl.XDebugSessionImpl
import com.intellij.xdebugger.impl.breakpoints.XExpressionImpl
import com.intellij.xdebugger.impl.frame.XDebugViewSessionListener
import com.intellij.xdebugger.impl.frame.XVariablesView
import com.intellij.xdebugger.impl.frame.XWatchesViewImpl
import com.intellij.xdebugger.impl.ui.XDebuggerUIConstants
import com.intellij.xdebugger.impl.ui.tree.ValueMarkup
import com.intellij.xdebugger.impl.ui.tree.XDebuggerTree
import com.intellij.xdebugger.impl.ui.tree.nodes.*
import com.sun.jdi.ObjectReference
import org.apache.log4j.AppenderSkeleton
import org.apache.log4j.Level
@@ -53,8 +58,8 @@ import org.jetbrains.kotlin.idea.util.application.runReadAction
import org.jetbrains.kotlin.test.InTextDirectivesUtils
import org.junit.Assert
import java.io.File
import java.util.Collections
import kotlin.test.fail
import java.util.*
import javax.swing.tree.TreeNode
public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestBase() {
private val logger = Logger.getLogger(javaClass<KotlinEvaluateExpressionCache>())!!
@@ -115,6 +120,9 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB
doStepping(path)
val variablesView = createVariablesView()
val watchesView = createWatchesView()
doOnBreakpoint {
val exceptions = linkedMapOf<String, Throwable>()
try {
@@ -131,8 +139,8 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB
}
}
finally {
if (shouldPrintFrame) {
printFrame()
if (shouldPrintFrame) {
printFrame(variablesView, watchesView)
println(fileText, ProcessOutputTypes.SYSTEM)
}
else {
@@ -174,25 +182,44 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB
finish()
}
private fun SuspendContextImpl.printFrame() {
val tree = FrameVariablesTree(getProject()!!)
Disposer.register(getTestRootDisposable()!!, tree);
private fun createWatchesView(): XWatchesViewImpl {
val session = myDebuggerSession.xDebugSession as XDebugSessionImpl
val watchesView = XWatchesViewImpl(session)
Disposer.register(testRootDisposable, watchesView)
session.addSessionListener(XDebugViewSessionListener(watchesView), testRootDisposable)
return watchesView
}
invokeRatherLater(this) {
tree.rebuild(debuggerContext)
expandAll(tree, Runnable {
try {
val printer = Printer()
printer.printTree(tree)
for (extra in getExtraVars()) {
printer.printDescriptor(tree.getNodeFactory().getWatchItemDescriptor(null, extra, null), 2)
private fun createVariablesView(): XVariablesView {
val session = myDebuggerSession.xDebugSession as XDebugSessionImpl
val variablesView = XVariablesView(session)
Disposer.register(testRootDisposable, variablesView)
session.addSessionListener(XDebugViewSessionListener(variablesView), testRootDisposable)
return variablesView
}
private fun SuspendContextImpl.printFrame(variablesView: XVariablesView, watchesView: XWatchesViewImpl) {
val tree = variablesView.tree!!
expandAll(
tree,
Runnable {
try {
Printer().printTree(tree)
for (extra in getExtraVars()) {
watchesView.addWatchExpression(XExpressionImpl.fromText(extra.text), -1, false);
}
Printer().printTree(watchesView.tree)
}
}
finally {
resume(this@printFrame)
}
})
}
finally {
resume(this)
}
},
hashSetOf(),
// TODO why this is needed? Otherwise some tests are never ended
DescriptorTestCase.NodeFilter { it !is XValueNodeImpl || it.name != "cause" },
this
)
}
fun getExtraVars(): Set<TextWithImports> {
@@ -200,15 +227,24 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB
}
private inner class Printer() {
fun printTree(tree: DebuggerTree) {
val root = tree.getMutableModel()!!.getRoot() as DebuggerTreeNodeImpl
fun printTree(tree: XDebuggerTree) {
val root = tree.treeModel.root as TreeNode
printNode(root, 0)
}
private fun printNode(node: DebuggerTreeNodeImpl, indent: Int) {
val descriptor: NodeDescriptorImpl = node.getDescriptor()!!
private fun printNode(node: TreeNode, indent: Int) {
val descriptor = when {
node is DebuggerTreeNodeImpl -> node.descriptor
node is XValueNodeImpl -> (node.valueContainer as? JavaValue)?.descriptor ?: MessageDescriptor(node.text.toString())
node is XStackFrameNode -> (node.valueContainer as? JavaStackFrame)?.descriptor
node is XValueGroupNodeImpl -> (node.valueContainer as? JavaStaticGroup)?.descriptor
node is WatchesRootNode -> null
node is WatchMessageNode -> WatchItemDescriptor(project, TextWithImportsImpl(CodeFragmentKind.EXPRESSION, node.expression.expression))
node is MessageTreeNode -> MessageDescriptor(node.text.toString())
else -> MessageDescriptor(node.toString())
}
if (printDescriptor(descriptor, indent)) return
if (descriptor != null && printDescriptor(descriptor, indent)) return
printChildren(node, indent + 2)
}
@@ -216,7 +252,11 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB
fun printDescriptor(descriptor: NodeDescriptorImpl, indent: Int): Boolean {
if (descriptor is DefaultNodeDescriptor) return true
val label = descriptor.getLabel()!!
var label = descriptor.label
// TODO: update presentation before calc label
if (label == NodeDescriptorImpl.UNKNOWN_VALUE_MESSAGE && descriptor is StaticDescriptor) {
label = "static = " + NodeRendererSettings.getInstance().classRenderer.renderTypeName(descriptor.type.name())
}
if (label.endsWith(XDebuggerUIConstants.COLLECTING_DATA_MESSAGE)) return true
val curIndent = " ".repeat(indent)
@@ -235,10 +275,10 @@ public abstract class AbstractKotlinEvaluateExpressionTest : KotlinDebuggerTestB
return false
}
private fun printChildren(node: DebuggerTreeNodeImpl, indent: Int) {
val e = node.rawChildren()!!
private fun printChildren(node: TreeNode, indent: Int) {
val e = node.children()
while (e.hasMoreElements()) {
printNode(e.nextElement() as DebuggerTreeNodeImpl, indent)
printNode(e.nextElement() as TreeNode, indent)
}
}

View File

@@ -4195,6 +4195,12 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/quickfix/migration/operatorModifier"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), true);
}
@TestMetadata("containsBool.kt")
public void testContainsBool() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/operatorModifier/containsBool.kt");
doTest(fileName);
}
@TestMetadata("containsInt.kt")
public void testContainsInt() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/operatorModifier/containsInt.kt");
@@ -4207,6 +4213,12 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
doTest(fileName);
}
@TestMetadata("overridden.kt")
public void testOverridden() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/operatorModifier/overridden.kt");
doTest(fileName);
}
@TestMetadata("simple.kt")
public void testSimple() throws Exception {
String fileName = JetTestUtils.navigationMetadata("idea/testData/quickfix/migration/operatorModifier/simple.kt");

View File

@@ -36,6 +36,7 @@ import org.jetbrains.jps.builders.logging.BuildLoggingManager
import org.jetbrains.jps.incremental.BuilderRegistry
import org.jetbrains.jps.incremental.IncProjectBuilder
import org.jetbrains.jps.incremental.messages.BuildMessage
import org.jetbrains.jps.incremental.messages.CompilerMessage
import org.jetbrains.jps.model.java.JpsJavaDependencyScope
import org.jetbrains.jps.model.java.JpsJavaExtensionService
import org.jetbrains.jps.model.module.JpsModule
@@ -480,7 +481,8 @@ public class KotlinJpsBuildTest : AbstractKotlinJpsBuildTestCase() {
result.assertFailed()
val actualErrors = result.getMessages(BuildMessage.Kind.ERROR)
.map { it.messageText }.sorted().joinToString("\n")
.map { it as CompilerMessage }
.map { "${it.messageText} at line ${it.line}, column ${it.column}" }.sorted().joinToString("\n")
val projectRoot = File(AbstractKotlinJpsBuildTestCase.TEST_DATA_PATH + "general/" + getTestName(false))
val expectedFile = File(projectRoot, "errors.txt")
JetTestUtils.assertEqualsToFile(expectedFile, actualErrors)

View File

@@ -1,3 +1,4 @@
'internal open val member: kotlin.Int defined in test.ClassBB1' has no access to 'internal abstract val member: kotlin.Int defined in test.ClassB1', so it cannot override it
Cannot access 'InternalClass1': it is 'internal' in 'test'
Cannot access 'member': it is 'invisible_fake' in 'ClassAA1'
'internal open val member: kotlin.Int defined in test.ClassBB1' has no access to 'internal abstract val member: kotlin.Int defined in test.ClassB1', so it cannot override it at line 11, column 14
Cannot access 'InternalClass1': it is 'internal' in 'test' at line 3, column 13
Cannot access 'InternalClass1': it is 'internal' in 'test' at line 6, column 36
Cannot access 'member': it is 'invisible_fake' in 'ClassAA1' at line 24, column 25

View File

@@ -1,5 +1,7 @@
package test
import test.InternalClass1
// InternalClass1, ClassA1, ClassB1 are in module1
class ClassInheritedFromInternal1: InternalClass1()

View File

@@ -6,10 +6,10 @@ package foo.bar
na /*c:foo.bar.A(equals)*/== a
na /*c:foo.bar.A(equals)*/== null
a /*c:foo.bar.A(compareTo)*/> b
a /*c:foo.bar.A(compareTo)*/< b
a /*c:foo.bar.A(compareTo)*/>= b
a /*c:foo.bar.A(compareTo)*/<= b
a /*c:foo.bar.A(compareTo) p:foo.bar(compareTo)*/> b
a /*c:foo.bar.A(compareTo) p:foo.bar(compareTo)*/< b
a /*c:foo.bar.A(compareTo) p:foo.bar(compareTo)*/>= b
a /*c:foo.bar.A(compareTo) p:foo.bar(compareTo)*/<= b
a /*c:foo.bar.A(compareTo) p:foo.bar(compareTo)*/> c
a /*c:foo.bar.A(compareTo) p:foo.bar(compareTo)*/< c

View File

@@ -3,22 +3,22 @@ package foo.bar
/*p:foo.bar*/fun testOperators(a: /*p:foo.bar*/A, b: /*p:foo.bar*/Int) {
var d = a
d/*c:foo.bar.A(inc)*/++
/*c:foo.bar.A(inc)*/++d
d/*c:foo.bar.A(inc) p:foo.bar(inc)*/++
/*c:foo.bar.A(inc) p:foo.bar(inc)*/++d
d/*c:foo.bar.A(dec) p:foo.bar(dec)*/--
/*c:foo.bar.A(dec) p:foo.bar(dec)*/--d
a /*c:foo.bar.A(plus)*/+ b
a /*c:foo.bar.A(plus) p:foo.bar(plus)*/+ b
a /*c:foo.bar.A(minus) p:foo.bar(minus)*/- b
/*c:foo.bar.A(not) p:foo.bar(not)*/!a
// for val
a /*c:foo.bar.A(timesAssign)*/*= b
a /*c:foo.bar.A(timesAssign) p:foo.bar(timesAssign)*/*= b
a /*c:foo.bar.A(divAssign) p:foo.bar(divAssign)*//= b
// for var
d /*c:foo.bar.A(plusAssign) p:foo.bar(plusAssign) c:foo.bar.A(plus)*/+= b
d /*c:foo.bar.A(plusAssign) p:foo.bar(plusAssign) c:foo.bar.A(plus) p:foo.bar(plus)*/+= b
d /*c:foo.bar.A(minusAssign) p:foo.bar(minusAssign) c:foo.bar.A(minus) p:foo.bar(minus)*/-= b
d /*c:foo.bar.A(timesAssign) c:foo.bar.A(times) p:foo.bar(times)*/*= b
d /*c:foo.bar.A(timesAssign) p:foo.bar(timesAssign) c:foo.bar.A(times) p:foo.bar(times)*/*= b
d /*c:foo.bar.A(divAssign) p:foo.bar(divAssign) c:foo.bar.A(div) p:foo.bar(div)*//= b
}

View File

@@ -1,16 +1,16 @@
package foo.bar
/*p:foo.bar*/fun testOther(a: /*p:foo.bar*/A, b: /*p:foo.bar*/Int, c: /*p:foo.bar*/Any, na: /*p:foo.bar*/A?) {
/*c:foo.bar.A(set) p:foo.bar(set)*/a[1] = /*c:foo.bar.A(get)*/a[2]
/*c:foo.bar.A(set) p:foo.bar(set)*/a[1] = /*c:foo.bar.A(get) p:foo.bar(get)*/a[2]
b /*c:foo.bar.A(contains)*/in a
b /*c:foo.bar.A(contains) p:foo.bar(contains)*/in a
"s" /*c:foo.bar.A(contains) p:foo.bar(contains)*/!in a
/*c:foo.bar.A(invoke)*/a()
/*c:foo.bar.A(invoke) p:foo.bar(invoke)*/a()
/*c:foo.bar.A(invoke) p:foo.bar(invoke)*/a(1)
val (/*c:foo.bar.A(component1)*/h, /*c:foo.bar.A(component2) p:foo.bar(component2)*/t) = a;
val (/*c:foo.bar.A(component1) p:foo.bar(component1)*/h, /*c:foo.bar.A(component2) p:foo.bar(component2)*/t) = a;
for ((/*c:foo.bar.A(component1)*/f, /*c:foo.bar.A(component2) p:foo.bar(component2)*/s) in /*c:foo.bar.A(iterator) c:foo.bar.A(hasNext) p:foo.bar(hasNext) c:foo.bar.A(next)*/a);
for ((/*c:foo.bar.A(component1)*/f, /*c:foo.bar.A(component2) p:foo.bar(component2)*/s) in /*c:foo.bar.A(iterator) p:foo.bar(iterator) c:foo.bar.A(hasNext) p:foo.bar(hasNext) c:foo.bar.A(next)*/na);
for ((/*c:foo.bar.A(component1) p:foo.bar(component1)*/f, /*c:foo.bar.A(component2) p:foo.bar(component2)*/s) in /*c:foo.bar.A(iterator) c:foo.bar.A(hasNext) p:foo.bar(hasNext) c:foo.bar.A(next)*/a);
for ((/*c:foo.bar.A(component1) p:foo.bar(component1)*/f, /*c:foo.bar.A(component2) p:foo.bar(component2)*/s) in /*c:foo.bar.A(iterator) p:foo.bar(iterator) c:foo.bar.A(hasNext) p:foo.bar(hasNext) c:foo.bar.A(next)*/na);
}

View File

@@ -1,4 +1,3 @@
@file:JvmVersion
package kotlin.template
import kotlin.dom. *

View File

@@ -21,7 +21,7 @@ import kotlin.annotation.AnnotationTarget.*
@Target(FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER)
@Retention(AnnotationRetention.RUNTIME)
@MustBeDocumented
@Deprecated("Use kotlin.jvm.platformName instead", ReplaceWith("kotlin.jvm.platformName"))
@Deprecated("Use kotlin.jvm.JvmName instead", ReplaceWith("kotlin.jvm.JvmName"))
public annotation class platformName(public val name: String)
@Target(FUNCTION, PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER)

View File

@@ -189,7 +189,7 @@ public fun String?.isNullOrBlank(): Boolean = this == null || this.isBlank()
/**
* Iterator for characters of given CharSequence.
*/
public fun CharSequence.iterator(): CharIterator = object : CharIterator() {
public operator fun CharSequence.iterator(): CharIterator = object : CharIterator() {
private var index = 0
public override fun nextChar(): Char = get(index++)

View File

@@ -1,19 +1,17 @@
<project name="Update Dependencies" default="update" xmlns:if="ant:if" xmlns:unless="ant:unless">
<property name="ideaVersion" value="142.4859.6"/>
<property name="ideaVersion" value="142.5047.6"/>
<property name="kotlin.bootstrap.branch" value=""/>
<property name="kotlin.bootstrap.branch.locator" value=""/>
<property name="kotlin.bootstrap.locator" value="buildType:bt345,tag:bootstrap,status:SUCCESS${kotlin.bootstrap.branch.locator}"/>
<property name="kotlin.bootstrap.locator.force" value="false"/>
<property name="kotlin.bootstrap.branch" value="M14"/>
<property name="kotlin.bootstrap.branch.locator" value=",branch:M14"/>
<property name="kotlin.bootstrap.locator" value="buildType:bt345,status:SUCCESS${kotlin.bootstrap.branch.locator}"/>
<property name="kotlin.bootstrap.locator.force" value="true"/>
<property name="markdown.locator" value="buildType:IntelliJMarkdownParser_Build,status:SUCCESS"/>
<property name="bootstrap.build.no.tests" value="false"/>
<!-- Uncomment to enable force version increment in branch. Set override.version.disabled to temporary disable feature without commits -->
<!--
<property name="override.version.url" value="https://teamcity.jetbrains.com/guestAuth/app/rest/builds/?locator=buildType:bt345,status:SUCCESS,count:1${kotlin.bootstrap.branch.locator}"/>
-->
<!--<property name="override.version.disabled" value="true"/>-->
<condition property="isWindows">