From 44e41c5d96bde6e400dcd1547139e7cd31bb8ee5 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Wed, 25 Jun 2014 17:44:52 +0400 Subject: [PATCH 01/20] Smart enter for do-while fixed - Do not brake code if some expression parsed as body for bare "do" - Fix isStatement() check --- .../plugin/editor/KotlinSmartEnterHandler.kt | 9 ++++-- .../editor/fixers/KotlinDoWhileFixer.kt | 2 +- .../codeInsight/smartEnter/SmartEnterTest.kt | 28 ++++++++++++++++++- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/editor/KotlinSmartEnterHandler.kt b/idea/src/org/jetbrains/jet/plugin/editor/KotlinSmartEnterHandler.kt index 91a10eba4b0..8ca5efbbfb7 100644 --- a/idea/src/org/jetbrains/jet/plugin/editor/KotlinSmartEnterHandler.kt +++ b/idea/src/org/jetbrains/jet/plugin/editor/KotlinSmartEnterHandler.kt @@ -36,6 +36,7 @@ import org.jetbrains.jet.lang.psi.JetFunctionLiteral import com.intellij.psi.tree.TokenSet import org.jetbrains.jet.JetNodeTypes import org.jetbrains.jet.lang.psi.JetLoopExpression +import org.jetbrains.jet.lexer.JetTokens public class KotlinSmartEnterHandler: SmartEnterProcessorWithFixers() { { @@ -120,8 +121,11 @@ public class KotlinSmartEnterHandler: SmartEnterProcessorWithFixers() { } } - private fun PsiElement.isJetStatement() = - getParent() is JetBlockExpression || (getParent()?.getNode()?.getElementType() in BRANCH_CONTAINERS) + private fun PsiElement.isJetStatement() = when { + getParent() is JetBlockExpression && getNode()?.getElementType() !in BRACES -> true + getParent()?.getNode()?.getElementType() in BRANCH_CONTAINERS && this !is JetBlockExpression -> true + else -> false + } class KotlinPlainEnterProcessor : SmartEnterProcessorWithFixers.FixEnterProcessor() { private fun getControlStatementBlock(caret: Int, element: PsiElement): JetExpression? { @@ -158,4 +162,5 @@ public class KotlinSmartEnterHandler: SmartEnterProcessorWithFixers() { } private val BRANCH_CONTAINERS = TokenSet.create(JetNodeTypes.THEN, JetNodeTypes.ELSE, JetNodeTypes.BODY) +private val BRACES = TokenSet.create(JetTokens.RBRACE, JetTokens.LBRACE) private fun JetParameter.isInLambdaExpression() = this.getParent()?.getParent() is JetFunctionLiteral diff --git a/idea/src/org/jetbrains/jet/plugin/editor/fixers/KotlinDoWhileFixer.kt b/idea/src/org/jetbrains/jet/plugin/editor/fixers/KotlinDoWhileFixer.kt index 88bb92c6454..77201f526cb 100644 --- a/idea/src/org/jetbrains/jet/plugin/editor/fixers/KotlinDoWhileFixer.kt +++ b/idea/src/org/jetbrains/jet/plugin/editor/fixers/KotlinDoWhileFixer.kt @@ -43,8 +43,8 @@ public class KotlinDoWhileFixer : SmartEnterProcessorWithFixers.Fixer stmt.startLine(doc)) { + doc.insertString(whileKeyword.range.start, "}") doc.insertString(start + "do".length(), "{") - doc.insertString(whileKeyword.range.start - 1, "}") return } diff --git a/idea/tests/org/jetbrains/jet/plugin/codeInsight/smartEnter/SmartEnterTest.kt b/idea/tests/org/jetbrains/jet/plugin/codeInsight/smartEnter/SmartEnterTest.kt index 72e0c45a850..7294b8d56d0 100644 --- a/idea/tests/org/jetbrains/jet/plugin/codeInsight/smartEnter/SmartEnterTest.kt +++ b/idea/tests/org/jetbrains/jet/plugin/codeInsight/smartEnter/SmartEnterTest.kt @@ -677,8 +677,8 @@ class SmartEnterTest : JetLightCodeInsightFixtureTestCase() { , """ do { + } while (true) - """ ) @@ -747,6 +747,32 @@ class SmartEnterTest : JetLightCodeInsightFixtureTestCase() { """ ) + fun testDoWhile13() = doFunTest( + """ + do + println("some") + """ + , + """ + do { + println("some") + } while () + """ + ) + + fun testDoWhile14() = doFunTest( + """ + do + println("some") + """ + , + """ + do { + println("some") + } while () + """ + ) + fun testDoWhileOneLine1() = doFunTest( """ do println("some") while (true) From 103daa841fa5021aeccef1b864fe7ec952c70b43 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Mon, 23 Jun 2014 21:01:01 +0400 Subject: [PATCH 02/20] Extract Function: Simplify computation of return type by pseudocode instruction --- .../extractFunction/extractFunctionUtils.kt | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/extractFunctionUtils.kt b/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/extractFunctionUtils.kt index 2d276e5abea..8e4bbee43e5 100644 --- a/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/extractFunctionUtils.kt +++ b/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/extractFunctionUtils.kt @@ -87,16 +87,10 @@ private fun List.getResultType( options: ExtractionOptions): JetType { fun instructionToType(instruction: Instruction): JetType? { val expression = when (instruction) { - is ReturnValueInstruction -> { + is ReturnValueInstruction -> (instruction.element as JetReturnExpression).getReturnedExpression() - } - is CallInstruction -> { - val callElement = instruction.resolvedCall.getCall().getCallElement() as? JetExpression - if (callElement is JetSimpleNameExpression) callElement.getParentByType(javaClass(), true) else callElement - } - is ReadValueInstruction, is OperationInstruction -> { - (instruction as JetElementInstruction).element as? JetExpression - } + is InstructionWithValue -> + instruction.outputValue?.element as? JetExpression else -> null } From 15611da98b2f2301d02334222c3c00a07568d1e7 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Tue, 24 Jun 2014 17:42:17 +0400 Subject: [PATCH 03/20] Extract Function: Add header to parameter table --- .../ui/KotlinParameterTablePanel.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/ui/KotlinParameterTablePanel.java b/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/ui/KotlinParameterTablePanel.java index 72416c626b0..a71bfff4cfc 100644 --- a/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/ui/KotlinParameterTablePanel.java +++ b/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/ui/KotlinParameterTablePanel.java @@ -116,12 +116,12 @@ public class KotlinParameterTablePanel extends JPanel { DefaultCellEditor defaultEditor = (DefaultCellEditor) myTable.getDefaultEditor(Object.class); defaultEditor.setClickCountToStart(1); - myTable.setTableHeader(null); myTable.getSelectionModel().setSelectionMode(ListSelectionModel.SINGLE_SELECTION); myTable.setCellSelectionEnabled(true); TableColumn checkBoxColumn = myTable.getColumnModel().getColumn(MyTableModel.CHECKMARK_COLUMN); TableUtil.setupCheckboxColumn(checkBoxColumn); + checkBoxColumn.setHeaderValue(""); checkBoxColumn.setCellRenderer( new BooleanTableCellRenderer() { @NotNull @@ -136,7 +136,11 @@ public class KotlinParameterTablePanel extends JPanel { } ); - myTable.getColumnModel().getColumn(MyTableModel.PARAMETER_TYPE_COLUMN).setCellRenderer(new DefaultTableCellRenderer() { + myTable.getColumnModel().getColumn(MyTableModel.PARAMETER_NAME_COLUMN).setHeaderValue("Name"); + + TableColumn parameterTypeColumn = myTable.getColumnModel().getColumn(MyTableModel.PARAMETER_TYPE_COLUMN); + parameterTypeColumn.setHeaderValue("Type"); + parameterTypeColumn.setCellRenderer(new DefaultTableCellRenderer() { private final JBComboBoxLabel myLabel = new JBComboBoxLabel(); @Override @@ -149,14 +153,14 @@ public class KotlinParameterTablePanel extends JPanel { myLabel.setForeground(isSelected ? table.getSelectionForeground() : table.getForeground()); if (isSelected) { myLabel.setSelectionIcon(); - } else { + } + else { myLabel.setRegularIcon(); } return myLabel; } }); - - myTable.getColumnModel().getColumn(MyTableModel.PARAMETER_TYPE_COLUMN).setCellEditor(new AbstractTableCellEditor() { + parameterTypeColumn.setCellEditor(new AbstractTableCellEditor() { final JBComboBoxTableCellEditorComponent myEditorComponent = new JBComboBoxTableCellEditorComponent(); @Override From 4d075b543753686b0f0bcbefa24fd318cfe3e2a2 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Tue, 24 Jun 2014 18:06:42 +0400 Subject: [PATCH 04/20] Extract Function: Make nameForRef extension property (so that it's not overriden by delegation and parameter rename works properly) --- .../refactoring/extractFunction/ExtractionDescriptor.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/ExtractionDescriptor.kt b/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/ExtractionDescriptor.kt index 8ea801675c4..b2dcc422396 100644 --- a/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/ExtractionDescriptor.kt +++ b/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/ExtractionDescriptor.kt @@ -43,11 +43,11 @@ trait Parameter { val parameterTypeCandidates: List val receiverCandidate: Boolean - val nameForRef: String get() = mirrorVarName ?: name - fun copy(name: String, parameterType: JetType): Parameter } +val Parameter.nameForRef: String get() = mirrorVarName ?: name + data class TypeParameter( val originalDeclaration: JetTypeParameter, val originalConstraints: List From c2aa824242656d8d0e5bf41baf9234931ef57048 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Tue, 24 Jun 2014 15:26:09 +0400 Subject: [PATCH 05/20] Implement light method equality based on the original declarations #KT-4350 Fixed --- .../jetbrains/jet/asJava/KotlinLightMethodForDeclaration.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/KotlinLightMethodForDeclaration.kt b/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/KotlinLightMethodForDeclaration.kt index 8e15f922e40..152147f86dd 100644 --- a/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/KotlinLightMethodForDeclaration.kt +++ b/compiler/jet.as.java.psi/src/org/jetbrains/jet/asJava/KotlinLightMethodForDeclaration.kt @@ -110,4 +110,9 @@ public class KotlinLightMethodForDeclaration( } override fun getUseScope(): SearchScope = origin.getUseScope() + + override fun equals(other: Any?): Boolean = + other is KotlinLightMethodForDeclaration && getName() == other.getName() && origin == other.origin + + override fun hashCode(): Int = getName().hashCode() * 31 + origin.hashCode() } From 86c8bfc864195f2070b97f19d4fda652da9851d1 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Tue, 24 Jun 2014 16:07:42 +0400 Subject: [PATCH 06/20] Find Usages: Add support of searching by reference in AbstractFindUsagesTest --- .../jet/findUsages/AbstractJetFindUsagesTest.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/idea/tests/org/jetbrains/jet/findUsages/AbstractJetFindUsagesTest.java b/idea/tests/org/jetbrains/jet/findUsages/AbstractJetFindUsagesTest.java index d747e42bf62..0a63fc33543 100644 --- a/idea/tests/org/jetbrains/jet/findUsages/AbstractJetFindUsagesTest.java +++ b/idea/tests/org/jetbrains/jet/findUsages/AbstractJetFindUsagesTest.java @@ -21,6 +21,7 @@ import com.google.common.base.Joiner; import com.google.common.base.Predicates; import com.google.common.collect.Collections2; import com.google.common.collect.Ordering; +import com.intellij.codeInsight.TargetElementUtilBase; import com.intellij.find.FindManager; import com.intellij.find.findUsages.*; import com.intellij.find.impl.FindManagerImpl; @@ -301,7 +302,11 @@ public abstract class AbstractJetFindUsagesTest extends LightCodeInsightFixtureT } myFixture.configureByFile(path); - T caretElement = PsiTreeUtil.getParentOfType(myFixture.getElementAtCaret(), caretElementClass, false); + PsiElement originalElement = + InTextDirectivesUtils.isDirectiveDefined(mainFileText, "// FIND_BY_REF") + ? TargetElementUtilBase.findTargetElement(myFixture.getEditor(), TargetElementUtilBase.REFERENCED_ELEMENT_ACCEPTED) + : myFixture.getElementAtCaret(); + T caretElement = PsiTreeUtil.getParentOfType(originalElement, caretElementClass, false); assertNotNull(String.format("Element with type '%s' wasn't found at caret position", caretElementClass), caretElement); FindUsagesOptions options = parser != null ? parser.parse(mainFileText, getProject()) : null; From 1452ffec6de44a69d7cb0dc60225e84b2df298e8 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Tue, 24 Jun 2014 16:08:29 +0400 Subject: [PATCH 07/20] Find Usages: Classify package usages #KT-4882 Fixed --- .../jetbrains/jet/plugin/JetBundle.properties | 2 ++ .../plugin/findUsages/JetUsageTypeProvider.kt | 22 +++++++++++++----- .../kotlinPackageUsages.0.kt | 10 ++++++++ .../kotlinPackageUsages.results.txt | 4 ++++ .../findUsages/AbstractJetFindUsagesTest.java | 10 ++++++++ .../JetFindUsagesTestGenerated.java | 23 ++++++++++++++----- 6 files changed, 59 insertions(+), 12 deletions(-) create mode 100644 idea/testData/findUsages/kotlin/findPackageUsages/kotlinPackageUsages.0.kt create mode 100644 idea/testData/findUsages/kotlin/findPackageUsages/kotlinPackageUsages.results.txt diff --git a/idea/src/org/jetbrains/jet/plugin/JetBundle.properties b/idea/src/org/jetbrains/jet/plugin/JetBundle.properties index 3b96bdecdcc..62aa43d0f39 100644 --- a/idea/src/org/jetbrains/jet/plugin/JetBundle.properties +++ b/idea/src/org/jetbrains/jet/plugin/JetBundle.properties @@ -366,6 +366,8 @@ usageType.super.type.qualifier = Super type qualifier usageType.receiver = Receiver usageType.selector = Selector usageType.delegate = Delegate +usageType.packageDirective = Package directive +usageType.packageMemberAccess = Package member access x.in.y={0} in {1} x.implements.y={0} in {1} implements {2} in {3}. diff --git a/idea/src/org/jetbrains/jet/plugin/findUsages/JetUsageTypeProvider.kt b/idea/src/org/jetbrains/jet/plugin/findUsages/JetUsageTypeProvider.kt index b68e64047d0..6596b198c92 100644 --- a/idea/src/org/jetbrains/jet/plugin/findUsages/JetUsageTypeProvider.kt +++ b/idea/src/org/jetbrains/jet/plugin/findUsages/JetUsageTypeProvider.kt @@ -17,12 +17,9 @@ package org.jetbrains.jet.plugin.findUsages import com.intellij.psi.PsiElement -import com.intellij.psi.tree.IElementType -import com.intellij.psi.util.PsiTreeUtil import com.intellij.usages.UsageTarget import com.intellij.usages.impl.rules.UsageType import com.intellij.usages.impl.rules.UsageTypeProviderEx -import org.jetbrains.annotations.Nullable import org.jetbrains.jet.lang.descriptors.* import org.jetbrains.jet.lang.psi.* import org.jetbrains.jet.lang.psi.psiUtil.* @@ -30,9 +27,8 @@ import org.jetbrains.jet.lang.resolve.BindingContext import org.jetbrains.jet.lexer.JetTokens import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache import org.jetbrains.jet.plugin.JetBundle -import org.jetbrains.jet.lang.resolve.java.descriptor.JavaPackageFragmentDescriptor -import org.jetbrains.jet.lang.resolve.java.lazy.descriptors.LazyJavaPackageFragment import org.jetbrains.jet.lang.resolve.DescriptorUtils +import com.intellij.psi.PsiPackage public object JetUsageTypeProvider : UsageTypeProviderEx { public override fun getUsageType(element: PsiElement?): UsageType? { @@ -166,6 +162,14 @@ public object JetUsageTypeProvider : UsageTypeProviderEx { } } + fun getPackageUsageType(): UsageType? { + return when { + simpleName.getParentByType(javaClass()) != null -> JetUsageTypes.PACKAGE_DIRECTIVE + simpleName.getParentByType(javaClass()) != null -> JetUsageTypes.PACKAGE_MEMBER_ACCESS + else -> getClassUsageType() + } + } + val usageType = getCommonUsageType() if (usageType != null) return usageType @@ -181,7 +185,9 @@ public object JetUsageTypeProvider : UsageTypeProviderEx { } else { getClassUsageType() } - is PackageViewDescriptor -> getClassUsageType() + is PackageViewDescriptor -> { + if (reference.getReference()?.resolve() is PsiPackage) getPackageUsageType() else getClassUsageType() + } is VariableDescriptor -> getVariableUsageType() is FunctionDescriptor -> getFunctionUsageType(descriptor) else -> null @@ -209,6 +215,10 @@ object JetUsageTypes { val RECEIVER = UsageType(JetBundle.message("usageType.receiver")) val DELEGATE = UsageType(JetBundle.message("usageType.delegate")) + // packages + val PACKAGE_DIRECTIVE = UsageType(JetBundle.message("usageType.packageDirective")) + val PACKAGE_MEMBER_ACCESS = UsageType(JetBundle.message("usageType.packageMemberAccess")) + // common usage types val CALLABLE_REFERENCE = UsageType(JetBundle.message("usageType.callable.reference")) } \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findPackageUsages/kotlinPackageUsages.0.kt b/idea/testData/findUsages/kotlin/findPackageUsages/kotlinPackageUsages.0.kt new file mode 100644 index 00000000000..59004567e9e --- /dev/null +++ b/idea/testData/findUsages/kotlin/findPackageUsages/kotlinPackageUsages.0.kt @@ -0,0 +1,10 @@ +// PSI_ELEMENT: com.intellij.psi.PsiPackage +// OPTIONS: usages +// FIND_BY_REF +package foo.bar + +import foo.bar.X + +class X + +val x: foo.bar.X? = foo.bar.X() \ No newline at end of file diff --git a/idea/testData/findUsages/kotlin/findPackageUsages/kotlinPackageUsages.results.txt b/idea/testData/findUsages/kotlin/findPackageUsages/kotlinPackageUsages.results.txt new file mode 100644 index 00000000000..94176e58b23 --- /dev/null +++ b/idea/testData/findUsages/kotlin/findPackageUsages/kotlinPackageUsages.results.txt @@ -0,0 +1,4 @@ +Class/object property type (10: 8) val x: foo.bar.X? = foo.bar.X() +Package directive (4: 9) package foo.bar +Package member access (10: 21) val x: foo.bar.X? = foo.bar.X() +Usage in import (6: 8) import foo.bar.X diff --git a/idea/tests/org/jetbrains/jet/findUsages/AbstractJetFindUsagesTest.java b/idea/tests/org/jetbrains/jet/findUsages/AbstractJetFindUsagesTest.java index 0a63fc33543..3b8ec3722fb 100644 --- a/idea/tests/org/jetbrains/jet/findUsages/AbstractJetFindUsagesTest.java +++ b/idea/tests/org/jetbrains/jet/findUsages/AbstractJetFindUsagesTest.java @@ -202,6 +202,13 @@ public abstract class AbstractJetFindUsagesTest extends LightCodeInsightFixtureT return new JavaVariableFindUsagesOptions(project); } }, + JAVA_PACKAGE { + @NotNull + @Override + public FindUsagesOptions parse(@NotNull String text, @NotNull Project project) { + return new JavaPackageFindUsagesOptions(project); + } + }, DEFAULT { @NotNull @Override @@ -247,6 +254,9 @@ public abstract class AbstractJetFindUsagesTest extends LightCodeInsightFixtureT if (klass == PsiField.class) { return JAVA_FIELD; } + if (klass == PsiPackage.class) { + return JAVA_PACKAGE; + } if (klass == JetTypeParameter.class) { return DEFAULT; } diff --git a/idea/tests/org/jetbrains/jet/findUsages/JetFindUsagesTestGenerated.java b/idea/tests/org/jetbrains/jet/findUsages/JetFindUsagesTestGenerated.java index a6613f63e57..345e7fb76ae 100644 --- a/idea/tests/org/jetbrains/jet/findUsages/JetFindUsagesTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/findUsages/JetFindUsagesTestGenerated.java @@ -16,24 +16,21 @@ package org.jetbrains.jet.findUsages; -import junit.framework.Assert; import junit.framework.Test; import junit.framework.TestSuite; - -import java.io.File; -import java.util.regex.Pattern; import org.jetbrains.jet.JetTestUtils; import org.jetbrains.jet.test.InnerTestClasses; import org.jetbrains.jet.test.TestMetadata; -import org.jetbrains.jet.findUsages.AbstractJetFindUsagesTest; +import java.io.File; +import java.util.regex.Pattern; /** This class is generated by {@link org.jetbrains.jet.generators.tests.TestsPackage}. DO NOT MODIFY MANUALLY */ @SuppressWarnings("all") @InnerTestClasses({JetFindUsagesTestGenerated.Kotlin.class, JetFindUsagesTestGenerated.Java.class}) public class JetFindUsagesTestGenerated extends AbstractJetFindUsagesTest { @TestMetadata("idea/testData/findUsages/kotlin") - @InnerTestClasses({Kotlin.FindClassUsages.class, Kotlin.FindFunctionUsages.class, Kotlin.FindObjectUsages.class, Kotlin.FindParameterUsages.class, Kotlin.FindPropertyUsages.class, Kotlin.FindTypeParameterUsages.class, Kotlin.FindWithFilteringImports.class, Kotlin.FindWithStructuralGrouping.class, Kotlin.UnresolvedAnnotation.class}) + @InnerTestClasses({Kotlin.FindClassUsages.class, Kotlin.FindFunctionUsages.class, Kotlin.FindObjectUsages.class, Kotlin.FindPackageUsages.class, Kotlin.FindParameterUsages.class, Kotlin.FindPropertyUsages.class, Kotlin.FindTypeParameterUsages.class, Kotlin.FindWithFilteringImports.class, Kotlin.FindWithStructuralGrouping.class, Kotlin.UnresolvedAnnotation.class}) public static class Kotlin extends AbstractJetFindUsagesTest { public void testAllFilesPresentInKotlin() throws Exception { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/findUsages/kotlin"), Pattern.compile("^(.+)\\.0\\.kt$"), true); @@ -388,6 +385,19 @@ public class JetFindUsagesTestGenerated extends AbstractJetFindUsagesTest { } + @TestMetadata("idea/testData/findUsages/kotlin/findPackageUsages") + public static class FindPackageUsages extends AbstractJetFindUsagesTest { + public void testAllFilesPresentInFindPackageUsages() throws Exception { + JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("idea/testData/findUsages/kotlin/findPackageUsages"), Pattern.compile("^(.+)\\.0\\.kt$"), true); + } + + @TestMetadata("kotlinPackageUsages.0.kt") + public void testKotlinPackageUsages() throws Exception { + doTest("idea/testData/findUsages/kotlin/findPackageUsages/kotlinPackageUsages.0.kt"); + } + + } + @TestMetadata("idea/testData/findUsages/kotlin/findParameterUsages") public static class FindParameterUsages extends AbstractJetFindUsagesTest { public void testAllFilesPresentInFindParameterUsages() throws Exception { @@ -587,6 +597,7 @@ public class JetFindUsagesTestGenerated extends AbstractJetFindUsagesTest { suite.addTestSuite(FindClassUsages.class); suite.addTestSuite(FindFunctionUsages.class); suite.addTestSuite(FindObjectUsages.class); + suite.addTestSuite(FindPackageUsages.class); suite.addTestSuite(FindParameterUsages.class); suite.addTestSuite(FindPropertyUsages.class); suite.addTestSuite(FindTypeParameterUsages.class); From cd44bc3fb04e181034106c5711afeed3967c1df2 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Wed, 25 Jun 2014 13:56:33 +0400 Subject: [PATCH 08/20] Introduce Variable: Do not compare explicit receivers using ReceiverValue #KT-5319 Fixed --- .../KotlinIntroduceVariableHandler.java | 24 ++++++++++++++----- .../introduceVariable/NoExplicitReceivers.kt | 12 ++++++++++ .../NoExplicitReceivers.kt.after | 13 ++++++++++ .../NoExplicitReceiversUnresolved.kt | 4 ++++ .../NoExplicitReceiversUnresolved.kt.after | 5 ++++ .../introduceVariable/OneExplicitReceiver.kt | 9 +++++++ .../OneExplicitReceiver.kt.after | 10 ++++++++ .../introduceVariable/TwoExplicitReceivers.kt | 12 ++++++++++ .../TwoExplicitReceivers.kt.after | 13 ++++++++++ .../JetExtractionTestGenerated.java | 20 ++++++++++++++++ 10 files changed, 116 insertions(+), 6 deletions(-) create mode 100644 idea/testData/refactoring/introduceVariable/NoExplicitReceivers.kt create mode 100644 idea/testData/refactoring/introduceVariable/NoExplicitReceivers.kt.after create mode 100644 idea/testData/refactoring/introduceVariable/NoExplicitReceiversUnresolved.kt create mode 100644 idea/testData/refactoring/introduceVariable/NoExplicitReceiversUnresolved.kt.after create mode 100644 idea/testData/refactoring/introduceVariable/OneExplicitReceiver.kt create mode 100644 idea/testData/refactoring/introduceVariable/OneExplicitReceiver.kt.after create mode 100644 idea/testData/refactoring/introduceVariable/TwoExplicitReceivers.kt create mode 100644 idea/testData/refactoring/introduceVariable/TwoExplicitReceivers.kt.after diff --git a/idea/src/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.java b/idea/src/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.java index 422ec0d83c3..a8bfc98b21b 100644 --- a/idea/src/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.java +++ b/idea/src/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.java @@ -461,6 +461,23 @@ public class KotlinIntroduceVariableHandler extends KotlinIntroduceHandlerBase { @Override public void visitExpression(@NotNull JetExpression expression) { if (PsiEquivalenceUtil.areElementsEquivalent(expression, actualExpression, null, new Comparator() { + private boolean compareCalleesAndReceivers(@NotNull ResolvedCall rc1, @NotNull ResolvedCall rc2) { + if (rc1.getResultingDescriptor() != rc2.getResultingDescriptor() || + rc1.getExplicitReceiverKind() != rc2.getExplicitReceiverKind()) return false; + + switch (rc1.getExplicitReceiverKind()) { + case NO_EXPLICIT_RECEIVER: + return rc1.getReceiverArgument() == rc2.getReceiverArgument() + && rc1.getThisObject() == rc2.getThisObject(); + case RECEIVER_ARGUMENT: + return rc1.getThisObject() == rc2.getThisObject(); + case THIS_OBJECT: + return rc1.getReceiverArgument() == rc2.getReceiverArgument(); + default: + return true; + } + } + @Override public int compare(@NotNull PsiElement element1, @NotNull PsiElement element2) { if (element1.getNode().getElementType() == JetTokens.IDENTIFIER && @@ -472,12 +489,7 @@ public class KotlinIntroduceVariableHandler extends KotlinIntroduceHandlerBase { ResolvedCall rc1 = bindingContext.get(BindingContext.RESOLVED_CALL, expr1); ResolvedCall rc2 = bindingContext.get(BindingContext.RESOLVED_CALL, expr2); - if (rc1 == null || rc2 == null) return rc1 == rc2 ? 0 : 1; - - return rc1.getResultingDescriptor() == rc2.getResultingDescriptor() - && rc1.getExplicitReceiverKind() == rc2.getExplicitReceiverKind() - && rc1.getReceiverArgument() == rc2.getReceiverArgument() - && rc1.getThisObject() == rc2.getThisObject() ? 0 : 1; + return (rc1 != null && rc2 != null) && compareCalleesAndReceivers(rc1, rc2) ? 0 : 1; } } if (!element1.textMatches(element2)) { diff --git a/idea/testData/refactoring/introduceVariable/NoExplicitReceivers.kt b/idea/testData/refactoring/introduceVariable/NoExplicitReceivers.kt new file mode 100644 index 00000000000..25aaada9d5c --- /dev/null +++ b/idea/testData/refactoring/introduceVariable/NoExplicitReceivers.kt @@ -0,0 +1,12 @@ +fun main(args: Array) { + with(A()) { + println(prop) + println(prop) + } +} + +class A { + val prop = 1 +} + +public inline fun with(receiver: T, f: T.() -> R): R = receiver.f() \ No newline at end of file diff --git a/idea/testData/refactoring/introduceVariable/NoExplicitReceivers.kt.after b/idea/testData/refactoring/introduceVariable/NoExplicitReceivers.kt.after new file mode 100644 index 00000000000..f7a5564a17e --- /dev/null +++ b/idea/testData/refactoring/introduceVariable/NoExplicitReceivers.kt.after @@ -0,0 +1,13 @@ +fun main(args: Array) { + with(A()) { + val i = prop + println(i) + println(i) + } +} + +class A { + val prop = 1 +} + +public inline fun with(receiver: T, f: T.() -> R): R = receiver.f() \ No newline at end of file diff --git a/idea/testData/refactoring/introduceVariable/NoExplicitReceiversUnresolved.kt b/idea/testData/refactoring/introduceVariable/NoExplicitReceiversUnresolved.kt new file mode 100644 index 00000000000..80f82ada789 --- /dev/null +++ b/idea/testData/refactoring/introduceVariable/NoExplicitReceiversUnresolved.kt @@ -0,0 +1,4 @@ +fun main(args: Array) { + println(a1) + println(a2) +} \ No newline at end of file diff --git a/idea/testData/refactoring/introduceVariable/NoExplicitReceiversUnresolved.kt.after b/idea/testData/refactoring/introduceVariable/NoExplicitReceiversUnresolved.kt.after new file mode 100644 index 00000000000..0a35a0444ac --- /dev/null +++ b/idea/testData/refactoring/introduceVariable/NoExplicitReceiversUnresolved.kt.after @@ -0,0 +1,5 @@ +fun main(args: Array) { + val a = a1 + println(a) + println(a2) +} \ No newline at end of file diff --git a/idea/testData/refactoring/introduceVariable/OneExplicitReceiver.kt b/idea/testData/refactoring/introduceVariable/OneExplicitReceiver.kt new file mode 100644 index 00000000000..a1d5d227d81 --- /dev/null +++ b/idea/testData/refactoring/introduceVariable/OneExplicitReceiver.kt @@ -0,0 +1,9 @@ +fun main(args: Array) { + val myA = A() + println(myA.prop) + println(myA.prop) +} + +class A { + val prop = 1 +} \ No newline at end of file diff --git a/idea/testData/refactoring/introduceVariable/OneExplicitReceiver.kt.after b/idea/testData/refactoring/introduceVariable/OneExplicitReceiver.kt.after new file mode 100644 index 00000000000..9e04e8bcfcb --- /dev/null +++ b/idea/testData/refactoring/introduceVariable/OneExplicitReceiver.kt.after @@ -0,0 +1,10 @@ +fun main(args: Array) { + val myA = A() + val i = myA.prop + println(i) + println(i) +} + +class A { + val prop = 1 +} \ No newline at end of file diff --git a/idea/testData/refactoring/introduceVariable/TwoExplicitReceivers.kt b/idea/testData/refactoring/introduceVariable/TwoExplicitReceivers.kt new file mode 100644 index 00000000000..2bebed4dcc7 --- /dev/null +++ b/idea/testData/refactoring/introduceVariable/TwoExplicitReceivers.kt @@ -0,0 +1,12 @@ +class Bar { +} + +class Foo() { + fun Bar.invoke(): Int = 1 +} + +fun main(args: Array) { + val f = Foo() + println(Bar().f()) + println(Bar().f()) +} \ No newline at end of file diff --git a/idea/testData/refactoring/introduceVariable/TwoExplicitReceivers.kt.after b/idea/testData/refactoring/introduceVariable/TwoExplicitReceivers.kt.after new file mode 100644 index 00000000000..31349566aed --- /dev/null +++ b/idea/testData/refactoring/introduceVariable/TwoExplicitReceivers.kt.after @@ -0,0 +1,13 @@ +class Bar { +} + +class Foo() { + fun Bar.invoke(): Int = 1 +} + +fun main(args: Array) { + val f = Foo() + val i = Bar().f() + println(i) + println(i) +} \ No newline at end of file diff --git a/idea/tests/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/JetExtractionTestGenerated.java b/idea/tests/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/JetExtractionTestGenerated.java index 1769329e2d3..617e11a6b3c 100644 --- a/idea/tests/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/JetExtractionTestGenerated.java +++ b/idea/tests/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/JetExtractionTestGenerated.java @@ -133,11 +133,26 @@ public class JetExtractionTestGenerated extends AbstractJetExtractionTest { doIntroduceVariableTest("idea/testData/refactoring/introduceVariable/noConflictWithInnerVariable.kt"); } + @TestMetadata("NoExplicitReceivers.kt") + public void testNoExplicitReceivers() throws Exception { + doIntroduceVariableTest("idea/testData/refactoring/introduceVariable/NoExplicitReceivers.kt"); + } + + @TestMetadata("NoExplicitReceiversUnresolved.kt") + public void testNoExplicitReceiversUnresolved() throws Exception { + doIntroduceVariableTest("idea/testData/refactoring/introduceVariable/NoExplicitReceiversUnresolved.kt"); + } + @TestMetadata("nonEquivalentReceivers.kt") public void testNonEquivalentReceivers() throws Exception { doIntroduceVariableTest("idea/testData/refactoring/introduceVariable/nonEquivalentReceivers.kt"); } + @TestMetadata("OneExplicitReceiver.kt") + public void testOneExplicitReceiver() throws Exception { + doIntroduceVariableTest("idea/testData/refactoring/introduceVariable/OneExplicitReceiver.kt"); + } + @TestMetadata("ReplaceOccurence.kt") public void testReplaceOccurence() throws Exception { doIntroduceVariableTest("idea/testData/refactoring/introduceVariable/ReplaceOccurence.kt"); @@ -158,6 +173,11 @@ public class JetExtractionTestGenerated extends AbstractJetExtractionTest { doIntroduceVariableTest("idea/testData/refactoring/introduceVariable/StringInjection.kt"); } + @TestMetadata("TwoExplicitReceivers.kt") + public void testTwoExplicitReceivers() throws Exception { + doIntroduceVariableTest("idea/testData/refactoring/introduceVariable/TwoExplicitReceivers.kt"); + } + @TestMetadata("WhenAddBlock.kt") public void testWhenAddBlock() throws Exception { doIntroduceVariableTest("idea/testData/refactoring/introduceVariable/WhenAddBlock.kt"); From d963ff31ae5f203a958101990cad05999cc1abcc Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 23 Jun 2014 10:07:24 +0400 Subject: [PATCH 09/20] Minor, don't fire up Swing thread in CLI tests --- compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java b/compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java index 12cd4d024cb..7ce9545b84d 100644 --- a/compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java +++ b/compiler/tests/org/jetbrains/jet/cli/CliBaseTest.java @@ -73,6 +73,7 @@ public class CliBaseTest { } private void executeCompilerCompareOutput(@NotNull CLICompiler compiler, @NotNull String testDataDir) throws Exception { + System.setProperty("java.awt.headless", "true"); Pair outputAndExitCode = executeCompilerGrabOutput(compiler, readArgs(testDataDir + "/" + testName.getMethodName() + ".args", testDataDir, tmpdir.getTmpDir().getPath())); From f51e172570d1046e091c69f395351086d54048ec Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 23 Jun 2014 10:05:02 +0400 Subject: [PATCH 10/20] Fix kotlinc command line usage information Fix spelling, case, minor grammar --- .../arguments/CommonCompilerArguments.java | 9 ++- .../arguments/K2JSCompilerArguments.java | 4 +- .../arguments/K2JVMCompilerArguments.java | 65 ++++++++++--------- compiler/testData/cli/jvm/help.out | 32 ++++----- compiler/testData/cli/jvm/inline/off.out | 32 ++++----- compiler/testData/cli/jvm/inline/on.out | 32 ++++----- compiler/testData/cli/jvm/inline/wrong.out | 32 ++++----- compiler/testData/cli/jvm/wrongArgument.out | 32 ++++----- 8 files changed, 122 insertions(+), 116 deletions(-) diff --git a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/CommonCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/CommonCompilerArguments.java index 129348a6203..f276e1cc217 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/CommonCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/CommonCompilerArguments.java @@ -25,15 +25,20 @@ import static org.jetbrains.jet.cli.common.arguments.CommonArgumentConstants.SUP public abstract class CommonCompilerArguments { @Argument(value = "tags", description = "Demarcate each compilation message (error, warning, etc) with an open and close tag") public boolean tags; + @Argument(value = "verbose", description = "Enable verbose logging output") public boolean verbose; + @Argument(value = "version", description = "Display compiler version") public boolean version; - @Argument(value = "help", alias = "h", description = "Show help") + + @Argument(value = "help", alias = "h", description = "Print a synopsis of standard options") public boolean help; + @Argument(value = "suppress", description = "Suppress compiler messages by severity (" + SUPPRESS_WARNINGS + ")") public String suppress; - @Argument(value = "printArgs", description = "Print commandline arguments") + + @Argument(value = "printArgs", description = "Print command line arguments") public boolean printArgs; public List freeArgs = new SmartList(); diff --git a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JSCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JSCompilerArguments.java index bcf0c91fbbf..5ed8f04927a 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JSCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JSCompilerArguments.java @@ -38,7 +38,7 @@ public class K2JSCompilerArguments extends CommonCompilerArguments { @Argument(value = "sourcemap", description = "Generate SourceMap") public boolean sourcemap; - @Argument(value = "target", description = "Generate js files for specific ECMA version (now support only ECMA 5)") + @Argument(value = "target", description = "Generate JS files for specific ECMA version (only ECMA 5 is supported)") public String target; @Nullable @@ -46,7 +46,7 @@ public class K2JSCompilerArguments extends CommonCompilerArguments { "' or '" + NO_CALL + "', default '" + CALL + "' (main function will be auto detected)") public String main; - @Argument(value = "outputPrefix", description = "Path to file which will be added to the begin of output file") + @Argument(value = "outputPrefix", description = "Path to file which will be added to the beginning of output file") public String outputPrefix; @Argument(value = "outputPostfix", description = "Path to file which will be added to the end of output file") diff --git a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java index 6366490a492..75013761f43 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java @@ -15,57 +15,58 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package org.jetbrains.jet.cli.common.arguments; import com.sampullara.cli.Argument; /** - * Command line arguments for the {@link K2JVMCompiler} + * Command line arguments for K2JVMCompiler */ @SuppressWarnings("UnusedDeclaration") public class K2JVMCompilerArguments extends CommonCompilerArguments { - @Argument(value = "jar", description = "jar file name") - public String jar; - - @Argument(value = "src", description = "source file or directory (allows many paths separated by the system path separator)") + @Argument(value = "src", description = "Source file or directory (allows many paths separated by the system path separator)") public String src; - @Argument(value = "classpath", description = "classpath to use when compiling") - public String classpath; + @Argument(value = "jar", description = "Resulting .jar file path") + public String jar; - @Argument(value = "annotations", description = "paths to external annotations") - public String annotations; - - @Argument(value = "includeRuntime", description = "include Kotlin runtime in to resulting jar") - public boolean includeRuntime; - - @Argument(value = "noJdk", description = "don't include Java runtime into classpath") - public boolean noJdk; - - @Argument(value = "noStdlib", description = "don't include Kotlin runtime into classpath") - public boolean noStdlib; - - @Argument(value = "noJdkAnnotations", description = "don't include JDK external annotations into classpath") - public boolean noJdkAnnotations; - - @Argument(value = "notNullAssertions", description = "generate not-null assertion after each invocation of method returning not-null") - public boolean notNullAssertions; - - @Argument(value = "notNullParamAssertions", description = "generate not-null assertions on parameters of methods accessible from Java") - public boolean notNullParamAssertions; - - @Argument(value = "output", description = "output directory") + @Argument(value = "output", description = "Output directory path for .class files") public String outputDir; - @Argument(value = "module", description = "module to compile") + @Argument(value = "classpath", description = "Paths where to find user class files") + public String classpath; + + @Argument(value = "annotations", description = "Paths to external annotations") + public String annotations; + + @Argument(value = "includeRuntime", description = "Include Kotlin runtime in to resulting .jar") + public boolean includeRuntime; + + @Argument(value = "noJdk", description = "Don't include Java runtime into classpath") + public boolean noJdk; + + @Argument(value = "noStdlib", description = "Don't include Kotlin runtime into classpath") + public boolean noStdlib; + + @Argument(value = "noJdkAnnotations", description = "Don't include JDK external annotations into classpath") + public boolean noJdkAnnotations; + + @Argument(value = "notNullAssertions", description = "Generate not-null assertion after each invocation of method returning not-null") + public boolean notNullAssertions; + + @Argument(value = "notNullParamAssertions", description = "Generate not-null assertions on parameters of methods accessible from Java") + public boolean notNullParamAssertions; + + @Argument(value = "module", description = "Path to the module file to compile") public String module; - @Argument(value = "script", description = "evaluate script") + @Argument(value = "script", description = "Evaluate the script file") public boolean script; @Argument(value = "kotlinHome", description = "Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery") public String kotlinHome; - @Argument(value = "inline", description = "Inlining mode: on/off or true/false (default is on)") + @Argument(value = "inline", description = "Inlining mode: on/off (default is on)") public String inline; } diff --git a/compiler/testData/cli/jvm/help.out b/compiler/testData/cli/jvm/help.out index b4de49e89ce..e1b9c316922 100644 --- a/compiler/testData/cli/jvm/help.out +++ b/compiler/testData/cli/jvm/help.out @@ -1,23 +1,23 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments - -jar [String] jar file name - -src [String] source file or directory (allows many paths separated by the system path separator) - -classpath [String] classpath to use when compiling - -annotations [String] paths to external annotations - -includeRuntime [flag] include Kotlin runtime in to resulting jar - -noJdk [flag] don't include Java runtime into classpath - -noStdlib [flag] don't include Kotlin runtime into classpath - -noJdkAnnotations [flag] don't include JDK external annotations into classpath - -notNullAssertions [flag] generate not-null assertion after each invocation of method returning not-null - -notNullParamAssertions [flag] generate not-null assertions on parameters of methods accessible from Java - -output [String] output directory - -module [String] module to compile - -script [flag] evaluate script + -src [String] Source file or directory (allows many paths separated by the system path separator) + -jar [String] Resulting .jar file path + -output [String] Output directory path for .class files + -classpath [String] Paths where to find user class files + -annotations [String] Paths to external annotations + -includeRuntime [flag] Include Kotlin runtime in to resulting .jar + -noJdk [flag] Don't include Java runtime into classpath + -noStdlib [flag] Don't include Kotlin runtime into classpath + -noJdkAnnotations [flag] Don't include JDK external annotations into classpath + -notNullAssertions [flag] Generate not-null assertion after each invocation of method returning not-null + -notNullParamAssertions [flag] Generate not-null assertions on parameters of methods accessible from Java + -module [String] Path to the module file to compile + -script [flag] Evaluate the script file -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off or true/false (default is on) + -inline [String] Inlining mode: on/off (default is on) -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose [flag] Enable verbose logging output -version [flag] Display compiler version - -help (-h) [flag] Show help + -help (-h) [flag] Print a synopsis of standard options -suppress [String] Suppress compiler messages by severity (warnings) - -printArgs [flag] Print commandline arguments + -printArgs [flag] Print command line arguments OK \ No newline at end of file diff --git a/compiler/testData/cli/jvm/inline/off.out b/compiler/testData/cli/jvm/inline/off.out index b4de49e89ce..e1b9c316922 100644 --- a/compiler/testData/cli/jvm/inline/off.out +++ b/compiler/testData/cli/jvm/inline/off.out @@ -1,23 +1,23 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments - -jar [String] jar file name - -src [String] source file or directory (allows many paths separated by the system path separator) - -classpath [String] classpath to use when compiling - -annotations [String] paths to external annotations - -includeRuntime [flag] include Kotlin runtime in to resulting jar - -noJdk [flag] don't include Java runtime into classpath - -noStdlib [flag] don't include Kotlin runtime into classpath - -noJdkAnnotations [flag] don't include JDK external annotations into classpath - -notNullAssertions [flag] generate not-null assertion after each invocation of method returning not-null - -notNullParamAssertions [flag] generate not-null assertions on parameters of methods accessible from Java - -output [String] output directory - -module [String] module to compile - -script [flag] evaluate script + -src [String] Source file or directory (allows many paths separated by the system path separator) + -jar [String] Resulting .jar file path + -output [String] Output directory path for .class files + -classpath [String] Paths where to find user class files + -annotations [String] Paths to external annotations + -includeRuntime [flag] Include Kotlin runtime in to resulting .jar + -noJdk [flag] Don't include Java runtime into classpath + -noStdlib [flag] Don't include Kotlin runtime into classpath + -noJdkAnnotations [flag] Don't include JDK external annotations into classpath + -notNullAssertions [flag] Generate not-null assertion after each invocation of method returning not-null + -notNullParamAssertions [flag] Generate not-null assertions on parameters of methods accessible from Java + -module [String] Path to the module file to compile + -script [flag] Evaluate the script file -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off or true/false (default is on) + -inline [String] Inlining mode: on/off (default is on) -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose [flag] Enable verbose logging output -version [flag] Display compiler version - -help (-h) [flag] Show help + -help (-h) [flag] Print a synopsis of standard options -suppress [String] Suppress compiler messages by severity (warnings) - -printArgs [flag] Print commandline arguments + -printArgs [flag] Print command line arguments OK \ No newline at end of file diff --git a/compiler/testData/cli/jvm/inline/on.out b/compiler/testData/cli/jvm/inline/on.out index b4de49e89ce..e1b9c316922 100644 --- a/compiler/testData/cli/jvm/inline/on.out +++ b/compiler/testData/cli/jvm/inline/on.out @@ -1,23 +1,23 @@ Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments - -jar [String] jar file name - -src [String] source file or directory (allows many paths separated by the system path separator) - -classpath [String] classpath to use when compiling - -annotations [String] paths to external annotations - -includeRuntime [flag] include Kotlin runtime in to resulting jar - -noJdk [flag] don't include Java runtime into classpath - -noStdlib [flag] don't include Kotlin runtime into classpath - -noJdkAnnotations [flag] don't include JDK external annotations into classpath - -notNullAssertions [flag] generate not-null assertion after each invocation of method returning not-null - -notNullParamAssertions [flag] generate not-null assertions on parameters of methods accessible from Java - -output [String] output directory - -module [String] module to compile - -script [flag] evaluate script + -src [String] Source file or directory (allows many paths separated by the system path separator) + -jar [String] Resulting .jar file path + -output [String] Output directory path for .class files + -classpath [String] Paths where to find user class files + -annotations [String] Paths to external annotations + -includeRuntime [flag] Include Kotlin runtime in to resulting .jar + -noJdk [flag] Don't include Java runtime into classpath + -noStdlib [flag] Don't include Kotlin runtime into classpath + -noJdkAnnotations [flag] Don't include JDK external annotations into classpath + -notNullAssertions [flag] Generate not-null assertion after each invocation of method returning not-null + -notNullParamAssertions [flag] Generate not-null assertions on parameters of methods accessible from Java + -module [String] Path to the module file to compile + -script [flag] Evaluate the script file -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off or true/false (default is on) + -inline [String] Inlining mode: on/off (default is on) -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose [flag] Enable verbose logging output -version [flag] Display compiler version - -help (-h) [flag] Show help + -help (-h) [flag] Print a synopsis of standard options -suppress [String] Suppress compiler messages by severity (warnings) - -printArgs [flag] Print commandline arguments + -printArgs [flag] Print command line arguments OK \ No newline at end of file diff --git a/compiler/testData/cli/jvm/inline/wrong.out b/compiler/testData/cli/jvm/inline/wrong.out index b94cebe4b2a..5a8e2d2e7e4 100644 --- a/compiler/testData/cli/jvm/inline/wrong.out +++ b/compiler/testData/cli/jvm/inline/wrong.out @@ -1,24 +1,24 @@ Wrong value for inline option: 'wrong'. Should be 'on'/'off' or 'true'/'false' Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments - -jar [String] jar file name - -src [String] source file or directory (allows many paths separated by the system path separator) - -classpath [String] classpath to use when compiling - -annotations [String] paths to external annotations - -includeRuntime [flag] include Kotlin runtime in to resulting jar - -noJdk [flag] don't include Java runtime into classpath - -noStdlib [flag] don't include Kotlin runtime into classpath - -noJdkAnnotations [flag] don't include JDK external annotations into classpath - -notNullAssertions [flag] generate not-null assertion after each invocation of method returning not-null - -notNullParamAssertions [flag] generate not-null assertions on parameters of methods accessible from Java - -output [String] output directory - -module [String] module to compile - -script [flag] evaluate script + -src [String] Source file or directory (allows many paths separated by the system path separator) + -jar [String] Resulting .jar file path + -output [String] Output directory path for .class files + -classpath [String] Paths where to find user class files + -annotations [String] Paths to external annotations + -includeRuntime [flag] Include Kotlin runtime in to resulting .jar + -noJdk [flag] Don't include Java runtime into classpath + -noStdlib [flag] Don't include Kotlin runtime into classpath + -noJdkAnnotations [flag] Don't include JDK external annotations into classpath + -notNullAssertions [flag] Generate not-null assertion after each invocation of method returning not-null + -notNullParamAssertions [flag] Generate not-null assertions on parameters of methods accessible from Java + -module [String] Path to the module file to compile + -script [flag] Evaluate the script file -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off or true/false (default is on) + -inline [String] Inlining mode: on/off (default is on) -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose [flag] Enable verbose logging output -version [flag] Display compiler version - -help (-h) [flag] Show help + -help (-h) [flag] Print a synopsis of standard options -suppress [String] Suppress compiler messages by severity (warnings) - -printArgs [flag] Print commandline arguments + -printArgs [flag] Print command line arguments INTERNAL_ERROR \ No newline at end of file diff --git a/compiler/testData/cli/jvm/wrongArgument.out b/compiler/testData/cli/jvm/wrongArgument.out index 4607a19838a..c8be2fd1b49 100644 --- a/compiler/testData/cli/jvm/wrongArgument.out +++ b/compiler/testData/cli/jvm/wrongArgument.out @@ -1,24 +1,24 @@ Invalid argument: -wrongArgument Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments - -jar [String] jar file name - -src [String] source file or directory (allows many paths separated by the system path separator) - -classpath [String] classpath to use when compiling - -annotations [String] paths to external annotations - -includeRuntime [flag] include Kotlin runtime in to resulting jar - -noJdk [flag] don't include Java runtime into classpath - -noStdlib [flag] don't include Kotlin runtime into classpath - -noJdkAnnotations [flag] don't include JDK external annotations into classpath - -notNullAssertions [flag] generate not-null assertion after each invocation of method returning not-null - -notNullParamAssertions [flag] generate not-null assertions on parameters of methods accessible from Java - -output [String] output directory - -module [String] module to compile - -script [flag] evaluate script + -src [String] Source file or directory (allows many paths separated by the system path separator) + -jar [String] Resulting .jar file path + -output [String] Output directory path for .class files + -classpath [String] Paths where to find user class files + -annotations [String] Paths to external annotations + -includeRuntime [flag] Include Kotlin runtime in to resulting .jar + -noJdk [flag] Don't include Java runtime into classpath + -noStdlib [flag] Don't include Kotlin runtime into classpath + -noJdkAnnotations [flag] Don't include JDK external annotations into classpath + -notNullAssertions [flag] Generate not-null assertion after each invocation of method returning not-null + -notNullParamAssertions [flag] Generate not-null assertions on parameters of methods accessible from Java + -module [String] Path to the module file to compile + -script [flag] Evaluate the script file -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off or true/false (default is on) + -inline [String] Inlining mode: on/off (default is on) -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag -verbose [flag] Enable verbose logging output -version [flag] Display compiler version - -help (-h) [flag] Show help + -help (-h) [flag] Print a synopsis of standard options -suppress [String] Suppress compiler messages by severity (warnings) - -printArgs [flag] Print commandline arguments + -printArgs [flag] Print command line arguments INTERNAL_ERROR \ No newline at end of file From 21440886278cf36d9fa778c29d1b3d515d34c784 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 23 Jun 2014 10:16:12 +0400 Subject: [PATCH 11/20] Don't output full compiler FQ name on -printArgs --- compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java | 2 +- compiler/testData/cli/js/printArgumentsWithManyValue.out | 2 +- compiler/testData/cli/jvm/printArguments.out | 2 +- .../jet/plugin/compilerMessages/JetCompilerMessagingTest.java | 2 +- .../jet/plugin/compilerMessages/K2JSCompilerMessagingTest.java | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java index c1ed663dc05..65b5183f309 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java @@ -200,7 +200,7 @@ public abstract class CLICompiler { String argumentsAsString = StringUtil.join(argumentsAsList, " "); String printArgsMessage = messageRenderer.render(CompilerMessageSeverity.INFO, - "Invoking compiler " + getClass().getName() + + "Invoking " + getClass().getSimpleName() + " with arguments " + argumentsAsString + freeArgs, CompilerMessageLocation.NO_LOCATION); errStream.println(printArgsMessage); diff --git a/compiler/testData/cli/js/printArgumentsWithManyValue.out b/compiler/testData/cli/js/printArgumentsWithManyValue.out index d3a95af24a1..f200514cb24 100644 --- a/compiler/testData/cli/js/printArgumentsWithManyValue.out +++ b/compiler/testData/cli/js/printArgumentsWithManyValue.out @@ -1,3 +1,3 @@ -INFO: Invoking compiler org.jetbrains.jet.cli.js.K2JSCompiler with arguments -suppress warnings -printArgs -sourceFiles compiler/testData/cli/js/simple2js.kt,compiler/testData/cli/js/../warnings.kt +INFO: Invoking K2JSCompiler with arguments -suppress warnings -printArgs -sourceFiles compiler/testData/cli/js/simple2js.kt,compiler/testData/cli/js/../warnings.kt ERROR: Specify output file via -output COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/printArguments.out b/compiler/testData/cli/jvm/printArguments.out index cac7a47734a..94f0cb25018 100644 --- a/compiler/testData/cli/jvm/printArguments.out +++ b/compiler/testData/cli/jvm/printArguments.out @@ -1,3 +1,3 @@ -INFO: Invoking compiler org.jetbrains.jet.cli.jvm.K2JVMCompiler with arguments -printArgs -script compiler/testData/cli/jvm/hello.kts +INFO: Invoking K2JVMCompiler with arguments -printArgs -script compiler/testData/cli/jvm/hello.kts hello OK diff --git a/idea/tests/org/jetbrains/jet/plugin/compilerMessages/JetCompilerMessagingTest.java b/idea/tests/org/jetbrains/jet/plugin/compilerMessages/JetCompilerMessagingTest.java index c023b8c6daa..702f39bd54e 100644 --- a/idea/tests/org/jetbrains/jet/plugin/compilerMessages/JetCompilerMessagingTest.java +++ b/idea/tests/org/jetbrains/jet/plugin/compilerMessages/JetCompilerMessagingTest.java @@ -81,7 +81,7 @@ public final class JetCompilerMessagingTest extends IDECompilerMessagingTest { @Override protected void checkHeader(@NotNull MessageChecker checker) { checker.expect(Message.info().textStartsWith("Using kotlinHome=")); - checker.expect(Message.info().textStartsWith("Invoking compiler")); + checker.expect(Message.info().textStartsWith("Invoking K2JVMCompiler")); checker.expect(Message.info().textStartsWith("Kotlin Compiler version")); checker.expect(Message.stats().textStartsWith("Using Kotlin home directory")); checker.expect(Message.stats().text("Configuring the compilation environment")); diff --git a/idea/tests/org/jetbrains/jet/plugin/compilerMessages/K2JSCompilerMessagingTest.java b/idea/tests/org/jetbrains/jet/plugin/compilerMessages/K2JSCompilerMessagingTest.java index 5b6d24d97df..5f1d0af97a8 100644 --- a/idea/tests/org/jetbrains/jet/plugin/compilerMessages/K2JSCompilerMessagingTest.java +++ b/idea/tests/org/jetbrains/jet/plugin/compilerMessages/K2JSCompilerMessagingTest.java @@ -101,7 +101,7 @@ public final class K2JSCompilerMessagingTest extends IDECompilerMessagingTest { @Override protected void checkHeader(@NotNull MessageChecker checker) { checker.expect(info().textStartsWith("Using kotlinHome=")); - checker.expect(info().textStartsWith("Invoking compiler")); + checker.expect(info().textStartsWith("Invoking K2JSCompiler")); checker.expect(info().textStartsWith("Kotlin Compiler version")); checker.expect(stats().textMatchesRegexp("Compiling source files: .*/src/test.kt")); } From ebec9e961ca43f6f05437a5723655118818629f0 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 23 Jun 2014 09:25:13 +0400 Subject: [PATCH 12/20] Use hand-written usage information printer Copy-pasted from com.sampullara.cli.Args --- .../jetbrains/jet/cli/common/CLICompiler.java | 15 +-- .../org/jetbrains/jet/cli/common/Usage.java | 113 ++++++++++++++++++ 2 files changed, 114 insertions(+), 14 deletions(-) create mode 100644 compiler/cli/src/org/jetbrains/jet/cli/common/Usage.java diff --git a/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java index 65b5183f309..c1ffd14788a 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/common/CLICompiler.java @@ -85,20 +85,7 @@ public abstract class CLICompiler { * Allow derived classes to add additional command line arguments */ protected void usage(@NotNull PrintStream target) { - // We should say something like - // Args.usage(target, K2JVMCompilerArguments.class); - // but currently cli-parser we are using does not support that - // a corresponding patch has been sent to the authors - // For now, we are using this: - PrintStream oldErr = System.err; - System.setErr(target); - try { - // TODO: use proper argv0 - Args.usage(createArguments()); - } - finally { - System.setErr(oldErr); - } + Usage.print(target, createArguments()); } /** diff --git a/compiler/cli/src/org/jetbrains/jet/cli/common/Usage.java b/compiler/cli/src/org/jetbrains/jet/cli/common/Usage.java new file mode 100644 index 00000000000..a43bb48d041 --- /dev/null +++ b/compiler/cli/src/org/jetbrains/jet/cli/common/Usage.java @@ -0,0 +1,113 @@ +/* + * Copyright 2010-2014 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.jet.cli.common; + +import com.sampullara.cli.Argument; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.jetbrains.jet.cli.common.arguments.CommonCompilerArguments; + +import java.io.PrintStream; +import java.lang.reflect.Array; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.List; + +class Usage { + private final PrintStream out; + + private Usage(@NotNull PrintStream out) { + this.out = out; + } + + public static void print(@NotNull PrintStream target, @NotNull CommonCompilerArguments arguments) { + new Usage(target).print(arguments); + } + + private void print(@NotNull CommonCompilerArguments arguments) { + Class clazz = arguments.getClass(); + out.println("Usage: " + clazz.getName()); + for (Class currentClass = clazz; currentClass != null; currentClass = currentClass.getSuperclass()) { + for (Field field : currentClass.getDeclaredFields()) { + Argument argument = field.getAnnotation(Argument.class); + if (argument == null) continue; + + try { + printFieldUsage(field, field.get(arguments), argument); + } + catch (IllegalAccessException e) { + throw new IllegalArgumentException("Could not use the field " + field + " as an argument field", e); + } + } + } + } + + private void printFieldUsage(@NotNull Field field, @Nullable Object defaultValue, @NotNull Argument argument) { + String prefix = argument.prefix(); + Class type = field.getType(); + String description = argument.description(); + + StringBuilder sb = new StringBuilder(" "); + sb.append(prefix); + if (argument.value().equals("")) { + sb.append(field.getName()); + } + else { + sb.append(argument.value()); + } + if (!argument.alias().equals("")) { + sb.append(" ("); + sb.append(prefix); + sb.append(argument.alias()); + sb.append(")"); + } + if (type == Boolean.TYPE || type == Boolean.class) { + sb.append(" [flag] "); + sb.append(description); + } + else { + sb.append(" ["); + if (type.isArray()) { + sb.append(type.getComponentType().getSimpleName()); + sb.append("["); + sb.append(argument.delimiter()); + sb.append("]"); + } + else { + sb.append(type.getSimpleName()); + } + sb.append("] "); + sb.append(description); + if (defaultValue != null) { + sb.append(" ("); + if (type.isArray()) { + int len = Array.getLength(defaultValue); + List list = new ArrayList(len); + for (int i = 0; i < len; i++) { + list.add(Array.get(defaultValue, i)); + } + sb.append(list); + } + else { + sb.append(defaultValue); + } + sb.append(")"); + } + } + out.println(sb); + } +} From 5e994778d14f4f5cfc5ad4c91e5b2c667ea5d05a Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 25 Jun 2014 21:42:32 +0400 Subject: [PATCH 13/20] Add test on "kotlinc-js -help" output --- compiler/testData/cli/js/jsHelp.args | 1 + compiler/testData/cli/js/jsHelp.out | 16 ++++++++++++++++ .../jet/cli/KotlincExecutableTestGenerated.java | 5 +++++ .../org/jetbrains/jet/cli/js/K2JsCliTest.java | 7 ++++++- 4 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 compiler/testData/cli/js/jsHelp.args create mode 100644 compiler/testData/cli/js/jsHelp.out diff --git a/compiler/testData/cli/js/jsHelp.args b/compiler/testData/cli/js/jsHelp.args new file mode 100644 index 00000000000..97f455ac44e --- /dev/null +++ b/compiler/testData/cli/js/jsHelp.args @@ -0,0 +1 @@ +-help diff --git a/compiler/testData/cli/js/jsHelp.out b/compiler/testData/cli/js/jsHelp.out new file mode 100644 index 00000000000..2f4778ace97 --- /dev/null +++ b/compiler/testData/cli/js/jsHelp.out @@ -0,0 +1,16 @@ +Usage: org.jetbrains.jet.cli.common.arguments.K2JSCompilerArguments + -output [String] Output file path + -libraryFiles [String[,]] Path to zipped lib sources or kotlin files + -sourceFiles [String[,]] Source files (dir or file) + -sourcemap [flag] Generate SourceMap + -target [String] Generate JS files for specific ECMA version (only ECMA 5 is supported) + -main [String] Whether a main function should be called; either 'call' or 'noCall', default 'call' (main function will be auto detected) + -outputPrefix [String] Path to file which will be added to the beginning of output file + -outputPostfix [String] Path to file which will be added to the end of output file + -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag + -verbose [flag] Enable verbose logging output + -version [flag] Display compiler version + -help (-h) [flag] Print a synopsis of standard options + -suppress [String] Suppress compiler messages by severity (warnings) + -printArgs [flag] Print command line arguments +OK \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/jet/cli/KotlincExecutableTestGenerated.java b/compiler/tests/org/jetbrains/jet/cli/KotlincExecutableTestGenerated.java index 870af9a1ab3..8b37391d1c9 100644 --- a/compiler/tests/org/jetbrains/jet/cli/KotlincExecutableTestGenerated.java +++ b/compiler/tests/org/jetbrains/jet/cli/KotlincExecutableTestGenerated.java @@ -171,6 +171,11 @@ public class KotlincExecutableTestGenerated extends AbstractKotlincExecutableTes JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/cli/js"), Pattern.compile("^(.+)\\.args$"), true); } + @TestMetadata("jsHelp.args") + public void testJsHelp() throws Exception { + doJsTest("compiler/testData/cli/js/jsHelp.args"); + } + @TestMetadata("outputPostfixFileNotFound.args") public void testOutputPostfixFileNotFound() throws Exception { doJsTest("compiler/testData/cli/js/outputPostfixFileNotFound.args"); diff --git a/compiler/tests/org/jetbrains/jet/cli/js/K2JsCliTest.java b/compiler/tests/org/jetbrains/jet/cli/js/K2JsCliTest.java index 27f3ef5998d..3c786f8e43b 100644 --- a/compiler/tests/org/jetbrains/jet/cli/js/K2JsCliTest.java +++ b/compiler/tests/org/jetbrains/jet/cli/js/K2JsCliTest.java @@ -16,8 +16,8 @@ package org.jetbrains.jet.cli.js; -import junit.framework.Assert; import org.jetbrains.jet.cli.CliBaseTest; +import org.junit.Assert; import org.junit.Test; import java.io.File; @@ -43,4 +43,9 @@ public class K2JsCliTest extends CliBaseTest { Assert.assertFalse(new File(tmpdir.getTmpDir(), "out.js").isFile()); } + + @Test + public void jsHelp() throws Exception { + executeCompilerCompareOutputJS(); + } } From ca219f988025223de9b85b92165513ac216dae00 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 23 Jun 2014 16:46:21 +0400 Subject: [PATCH 14/20] Beautify kotlinc -help output --- .../arguments/CommonCompilerArguments.java | 10 ++- .../arguments/K2JSCompilerArguments.java | 21 ++++- .../arguments/K2JVMCompilerArguments.java | 17 +++- .../common/arguments/ValueDescription.java | 28 ++++++ .../org/jetbrains/jet/cli/common/Usage.java | 86 ++++++------------- compiler/testData/cli/js/jsHelp.out | 31 +++---- compiler/testData/cli/jvm/help.out | 45 +++++----- compiler/testData/cli/jvm/inline/off.out | 45 +++++----- compiler/testData/cli/jvm/inline/on.out | 45 +++++----- compiler/testData/cli/jvm/inline/wrong.out | 45 +++++----- compiler/testData/cli/jvm/wrongArgument.out | 45 +++++----- 11 files changed, 226 insertions(+), 192 deletions(-) create mode 100644 compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/ValueDescription.java diff --git a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/CommonCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/CommonCompilerArguments.java index f276e1cc217..d941f9c1cc0 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/CommonCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/CommonCompilerArguments.java @@ -18,8 +18,10 @@ package org.jetbrains.jet.cli.common.arguments; import com.intellij.util.SmartList; import com.sampullara.cli.Argument; +import org.jetbrains.annotations.NotNull; import java.util.List; + import static org.jetbrains.jet.cli.common.arguments.CommonArgumentConstants.SUPPRESS_WARNINGS; public abstract class CommonCompilerArguments { @@ -35,7 +37,8 @@ public abstract class CommonCompilerArguments { @Argument(value = "help", alias = "h", description = "Print a synopsis of standard options") public boolean help; - @Argument(value = "suppress", description = "Suppress compiler messages by severity (" + SUPPRESS_WARNINGS + ")") + @Argument(value = "suppress", description = "Suppress all compiler warnings") + @ValueDescription(SUPPRESS_WARNINGS) public String suppress; @Argument(value = "printArgs", description = "Print command line arguments") @@ -47,6 +50,11 @@ public abstract class CommonCompilerArguments { return SUPPRESS_WARNINGS.equalsIgnoreCase(suppress); } + @NotNull + public String executableScriptFileName() { + return "kotlinc"; + } + // Used only for serialize and deserialize settings. Don't use in other places! public static final class DummyImpl extends CommonCompilerArguments {} } diff --git a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JSCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JSCompilerArguments.java index 5ed8f04927a..f7a01cecdbd 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JSCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JSCompilerArguments.java @@ -17,6 +17,7 @@ package org.jetbrains.jet.cli.common.arguments; import com.sampullara.cli.Argument; +import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import static org.jetbrains.jet.cli.common.arguments.K2JsArgumentConstants.CALL; @@ -27,28 +28,40 @@ import static org.jetbrains.jet.cli.common.arguments.K2JsArgumentConstants.NO_CA */ public class K2JSCompilerArguments extends CommonCompilerArguments { @Argument(value = "output", description = "Output file path") + @ValueDescription("") public String outputFile; - @Argument(value = "libraryFiles", description = "Path to zipped lib sources or kotlin files") + @Argument(value = "libraryFiles", description = "Path to zipped library sources or kotlin files separated by commas") + @ValueDescription("") public String[] libraryFiles; - @Argument(value = "sourceFiles", description = "Source files (dir or file)") + @Argument(value = "sourceFiles", description = "Source files or directories separated by commas") + @ValueDescription("") public String[] sourceFiles; @Argument(value = "sourcemap", description = "Generate SourceMap") public boolean sourcemap; @Argument(value = "target", description = "Generate JS files for specific ECMA version (only ECMA 5 is supported)") + @ValueDescription("") public String target; @Nullable - @Argument(value = "main", description = "Whether a main function should be called; either '" + CALL + - "' or '" + NO_CALL + "', default '" + CALL + "' (main function will be auto detected)") + @Argument(value = "main", description = "Whether a main function should be called; default '" + CALL + "' (main function will be auto detected)") + @ValueDescription("{" + CALL + "," + NO_CALL + "}") public String main; @Argument(value = "outputPrefix", description = "Path to file which will be added to the beginning of output file") + @ValueDescription("") public String outputPrefix; @Argument(value = "outputPostfix", description = "Path to file which will be added to the end of output file") + @ValueDescription("") public String outputPostfix; + + @Override + @NotNull + public String executableScriptFileName() { + return "kotlinc-js"; + } } diff --git a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java index 75013761f43..6b2d162d64b 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/K2JVMCompilerArguments.java @@ -19,6 +19,7 @@ package org.jetbrains.jet.cli.common.arguments; import com.sampullara.cli.Argument; +import org.jetbrains.annotations.NotNull; /** * Command line arguments for K2JVMCompiler @@ -26,18 +27,23 @@ import com.sampullara.cli.Argument; @SuppressWarnings("UnusedDeclaration") public class K2JVMCompilerArguments extends CommonCompilerArguments { @Argument(value = "src", description = "Source file or directory (allows many paths separated by the system path separator)") + @ValueDescription("") public String src; @Argument(value = "jar", description = "Resulting .jar file path") + @ValueDescription("") public String jar; @Argument(value = "output", description = "Output directory path for .class files") + @ValueDescription("") public String outputDir; @Argument(value = "classpath", description = "Paths where to find user class files") + @ValueDescription("") public String classpath; @Argument(value = "annotations", description = "Paths to external annotations") + @ValueDescription("") public String annotations; @Argument(value = "includeRuntime", description = "Include Kotlin runtime in to resulting .jar") @@ -59,14 +65,23 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments { public boolean notNullParamAssertions; @Argument(value = "module", description = "Path to the module file to compile") + @ValueDescription("") public String module; @Argument(value = "script", description = "Evaluate the script file") public boolean script; @Argument(value = "kotlinHome", description = "Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery") + @ValueDescription("") public String kotlinHome; - @Argument(value = "inline", description = "Inlining mode: on/off (default is on)") + @Argument(value = "inline", description = "Inlining mode (default is on)") + @ValueDescription("{on,off}") public String inline; + + @Override + @NotNull + public String executableScriptFileName() { + return "kotlinc-jvm"; + } } diff --git a/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/ValueDescription.java b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/ValueDescription.java new file mode 100644 index 00000000000..f0e6480129d --- /dev/null +++ b/compiler/cli/cli-common/src/org/jetbrains/jet/cli/common/arguments/ValueDescription.java @@ -0,0 +1,28 @@ +/* + * Copyright 2010-2014 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.jet.cli.common.arguments; + +import org.jetbrains.annotations.NotNull; + +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; + +@Retention(RetentionPolicy.RUNTIME) +public @interface ValueDescription { + @NotNull + String value(); +} diff --git a/compiler/cli/src/org/jetbrains/jet/cli/common/Usage.java b/compiler/cli/src/org/jetbrains/jet/cli/common/Usage.java index a43bb48d041..d6d53997bce 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/common/Usage.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/common/Usage.java @@ -20,94 +20,58 @@ import com.sampullara.cli.Argument; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.cli.common.arguments.CommonCompilerArguments; +import org.jetbrains.jet.cli.common.arguments.ValueDescription; import java.io.PrintStream; -import java.lang.reflect.Array; import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.List; class Usage { - private final PrintStream out; - - private Usage(@NotNull PrintStream out) { - this.out = out; - } + // The magic number 29 corresponds to the similar padding width in javac and scalac command line compilers + private static final int OPTION_NAME_PADDING_WIDTH = 29; public static void print(@NotNull PrintStream target, @NotNull CommonCompilerArguments arguments) { - new Usage(target).print(arguments); - } - - private void print(@NotNull CommonCompilerArguments arguments) { - Class clazz = arguments.getClass(); - out.println("Usage: " + clazz.getName()); - for (Class currentClass = clazz; currentClass != null; currentClass = currentClass.getSuperclass()) { - for (Field field : currentClass.getDeclaredFields()) { - Argument argument = field.getAnnotation(Argument.class); - if (argument == null) continue; - - try { - printFieldUsage(field, field.get(arguments), argument); - } - catch (IllegalAccessException e) { - throw new IllegalArgumentException("Could not use the field " + field + " as an argument field", e); + target.println("Usage: " + arguments.executableScriptFileName() + " "); + target.println("where possible options include:"); + for (Class clazz = arguments.getClass(); clazz != null; clazz = clazz.getSuperclass()) { + for (Field field : clazz.getDeclaredFields()) { + String usage = fieldUsage(field); + if (usage != null) { + target.println(usage); } } } } - private void printFieldUsage(@NotNull Field field, @Nullable Object defaultValue, @NotNull Argument argument) { + @Nullable + private static String fieldUsage(@NotNull Field field) { + Argument argument = field.getAnnotation(Argument.class); + if (argument == null) return null; + ValueDescription description = field.getAnnotation(ValueDescription.class); + String prefix = argument.prefix(); - Class type = field.getType(); - String description = argument.description(); StringBuilder sb = new StringBuilder(" "); sb.append(prefix); - if (argument.value().equals("")) { + if (argument.value().isEmpty()) { sb.append(field.getName()); } else { sb.append(argument.value()); } - if (!argument.alias().equals("")) { + if (!argument.alias().isEmpty()) { sb.append(" ("); sb.append(prefix); sb.append(argument.alias()); sb.append(")"); } - if (type == Boolean.TYPE || type == Boolean.class) { - sb.append(" [flag] "); - sb.append(description); + if (description != null) { + sb.append(" "); + sb.append(description.value()); } - else { - sb.append(" ["); - if (type.isArray()) { - sb.append(type.getComponentType().getSimpleName()); - sb.append("["); - sb.append(argument.delimiter()); - sb.append("]"); - } - else { - sb.append(type.getSimpleName()); - } - sb.append("] "); - sb.append(description); - if (defaultValue != null) { - sb.append(" ("); - if (type.isArray()) { - int len = Array.getLength(defaultValue); - List list = new ArrayList(len); - for (int i = 0; i < len; i++) { - list.add(Array.get(defaultValue, i)); - } - sb.append(list); - } - else { - sb.append(defaultValue); - } - sb.append(")"); - } + while (sb.length() < OPTION_NAME_PADDING_WIDTH) { + sb.append(" "); } - out.println(sb); + sb.append(argument.description()); + return sb.toString(); } } diff --git a/compiler/testData/cli/js/jsHelp.out b/compiler/testData/cli/js/jsHelp.out index 2f4778ace97..8641c254d2a 100644 --- a/compiler/testData/cli/js/jsHelp.out +++ b/compiler/testData/cli/js/jsHelp.out @@ -1,16 +1,17 @@ -Usage: org.jetbrains.jet.cli.common.arguments.K2JSCompilerArguments - -output [String] Output file path - -libraryFiles [String[,]] Path to zipped lib sources or kotlin files - -sourceFiles [String[,]] Source files (dir or file) - -sourcemap [flag] Generate SourceMap - -target [String] Generate JS files for specific ECMA version (only ECMA 5 is supported) - -main [String] Whether a main function should be called; either 'call' or 'noCall', default 'call' (main function will be auto detected) - -outputPrefix [String] Path to file which will be added to the beginning of output file - -outputPostfix [String] Path to file which will be added to the end of output file - -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag - -verbose [flag] Enable verbose logging output - -version [flag] Display compiler version - -help (-h) [flag] Print a synopsis of standard options - -suppress [String] Suppress compiler messages by severity (warnings) - -printArgs [flag] Print command line arguments +Usage: kotlinc-js +where possible options include: + -output Output file path + -libraryFiles Path to zipped library sources or kotlin files separated by commas + -sourceFiles Source files or directories separated by commas + -sourcemap Generate SourceMap + -target Generate JS files for specific ECMA version (only ECMA 5 is supported) + -main {call,noCall} Whether a main function should be called; default 'call' (main function will be auto detected) + -outputPrefix Path to file which will be added to the beginning of output file + -outputPostfix Path to file which will be added to the end of output file + -tags Demarcate each compilation message (error, warning, etc) with an open and close tag + -verbose Enable verbose logging output + -version Display compiler version + -help (-h) Print a synopsis of standard options + -suppress warnings Suppress all compiler warnings + -printArgs Print command line arguments OK \ No newline at end of file diff --git a/compiler/testData/cli/jvm/help.out b/compiler/testData/cli/jvm/help.out index e1b9c316922..93f42398265 100644 --- a/compiler/testData/cli/jvm/help.out +++ b/compiler/testData/cli/jvm/help.out @@ -1,23 +1,24 @@ -Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments - -src [String] Source file or directory (allows many paths separated by the system path separator) - -jar [String] Resulting .jar file path - -output [String] Output directory path for .class files - -classpath [String] Paths where to find user class files - -annotations [String] Paths to external annotations - -includeRuntime [flag] Include Kotlin runtime in to resulting .jar - -noJdk [flag] Don't include Java runtime into classpath - -noStdlib [flag] Don't include Kotlin runtime into classpath - -noJdkAnnotations [flag] Don't include JDK external annotations into classpath - -notNullAssertions [flag] Generate not-null assertion after each invocation of method returning not-null - -notNullParamAssertions [flag] Generate not-null assertions on parameters of methods accessible from Java - -module [String] Path to the module file to compile - -script [flag] Evaluate the script file - -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off (default is on) - -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag - -verbose [flag] Enable verbose logging output - -version [flag] Display compiler version - -help (-h) [flag] Print a synopsis of standard options - -suppress [String] Suppress compiler messages by severity (warnings) - -printArgs [flag] Print command line arguments +Usage: kotlinc-jvm +where possible options include: + -src Source file or directory (allows many paths separated by the system path separator) + -jar Resulting .jar file path + -output Output directory path for .class files + -classpath Paths where to find user class files + -annotations Paths to external annotations + -includeRuntime Include Kotlin runtime in to resulting .jar + -noJdk Don't include Java runtime into classpath + -noStdlib Don't include Kotlin runtime into classpath + -noJdkAnnotations Don't include JDK external annotations into classpath + -notNullAssertions Generate not-null assertion after each invocation of method returning not-null + -notNullParamAssertions Generate not-null assertions on parameters of methods accessible from Java + -module Path to the module file to compile + -script Evaluate the script file + -kotlinHome Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery + -inline {on,off} Inlining mode (default is on) + -tags Demarcate each compilation message (error, warning, etc) with an open and close tag + -verbose Enable verbose logging output + -version Display compiler version + -help (-h) Print a synopsis of standard options + -suppress warnings Suppress all compiler warnings + -printArgs Print command line arguments OK \ No newline at end of file diff --git a/compiler/testData/cli/jvm/inline/off.out b/compiler/testData/cli/jvm/inline/off.out index e1b9c316922..93f42398265 100644 --- a/compiler/testData/cli/jvm/inline/off.out +++ b/compiler/testData/cli/jvm/inline/off.out @@ -1,23 +1,24 @@ -Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments - -src [String] Source file or directory (allows many paths separated by the system path separator) - -jar [String] Resulting .jar file path - -output [String] Output directory path for .class files - -classpath [String] Paths where to find user class files - -annotations [String] Paths to external annotations - -includeRuntime [flag] Include Kotlin runtime in to resulting .jar - -noJdk [flag] Don't include Java runtime into classpath - -noStdlib [flag] Don't include Kotlin runtime into classpath - -noJdkAnnotations [flag] Don't include JDK external annotations into classpath - -notNullAssertions [flag] Generate not-null assertion after each invocation of method returning not-null - -notNullParamAssertions [flag] Generate not-null assertions on parameters of methods accessible from Java - -module [String] Path to the module file to compile - -script [flag] Evaluate the script file - -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off (default is on) - -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag - -verbose [flag] Enable verbose logging output - -version [flag] Display compiler version - -help (-h) [flag] Print a synopsis of standard options - -suppress [String] Suppress compiler messages by severity (warnings) - -printArgs [flag] Print command line arguments +Usage: kotlinc-jvm +where possible options include: + -src Source file or directory (allows many paths separated by the system path separator) + -jar Resulting .jar file path + -output Output directory path for .class files + -classpath Paths where to find user class files + -annotations Paths to external annotations + -includeRuntime Include Kotlin runtime in to resulting .jar + -noJdk Don't include Java runtime into classpath + -noStdlib Don't include Kotlin runtime into classpath + -noJdkAnnotations Don't include JDK external annotations into classpath + -notNullAssertions Generate not-null assertion after each invocation of method returning not-null + -notNullParamAssertions Generate not-null assertions on parameters of methods accessible from Java + -module Path to the module file to compile + -script Evaluate the script file + -kotlinHome Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery + -inline {on,off} Inlining mode (default is on) + -tags Demarcate each compilation message (error, warning, etc) with an open and close tag + -verbose Enable verbose logging output + -version Display compiler version + -help (-h) Print a synopsis of standard options + -suppress warnings Suppress all compiler warnings + -printArgs Print command line arguments OK \ No newline at end of file diff --git a/compiler/testData/cli/jvm/inline/on.out b/compiler/testData/cli/jvm/inline/on.out index e1b9c316922..93f42398265 100644 --- a/compiler/testData/cli/jvm/inline/on.out +++ b/compiler/testData/cli/jvm/inline/on.out @@ -1,23 +1,24 @@ -Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments - -src [String] Source file or directory (allows many paths separated by the system path separator) - -jar [String] Resulting .jar file path - -output [String] Output directory path for .class files - -classpath [String] Paths where to find user class files - -annotations [String] Paths to external annotations - -includeRuntime [flag] Include Kotlin runtime in to resulting .jar - -noJdk [flag] Don't include Java runtime into classpath - -noStdlib [flag] Don't include Kotlin runtime into classpath - -noJdkAnnotations [flag] Don't include JDK external annotations into classpath - -notNullAssertions [flag] Generate not-null assertion after each invocation of method returning not-null - -notNullParamAssertions [flag] Generate not-null assertions on parameters of methods accessible from Java - -module [String] Path to the module file to compile - -script [flag] Evaluate the script file - -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off (default is on) - -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag - -verbose [flag] Enable verbose logging output - -version [flag] Display compiler version - -help (-h) [flag] Print a synopsis of standard options - -suppress [String] Suppress compiler messages by severity (warnings) - -printArgs [flag] Print command line arguments +Usage: kotlinc-jvm +where possible options include: + -src Source file or directory (allows many paths separated by the system path separator) + -jar Resulting .jar file path + -output Output directory path for .class files + -classpath Paths where to find user class files + -annotations Paths to external annotations + -includeRuntime Include Kotlin runtime in to resulting .jar + -noJdk Don't include Java runtime into classpath + -noStdlib Don't include Kotlin runtime into classpath + -noJdkAnnotations Don't include JDK external annotations into classpath + -notNullAssertions Generate not-null assertion after each invocation of method returning not-null + -notNullParamAssertions Generate not-null assertions on parameters of methods accessible from Java + -module Path to the module file to compile + -script Evaluate the script file + -kotlinHome Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery + -inline {on,off} Inlining mode (default is on) + -tags Demarcate each compilation message (error, warning, etc) with an open and close tag + -verbose Enable verbose logging output + -version Display compiler version + -help (-h) Print a synopsis of standard options + -suppress warnings Suppress all compiler warnings + -printArgs Print command line arguments OK \ No newline at end of file diff --git a/compiler/testData/cli/jvm/inline/wrong.out b/compiler/testData/cli/jvm/inline/wrong.out index 5a8e2d2e7e4..b00f6dc45ea 100644 --- a/compiler/testData/cli/jvm/inline/wrong.out +++ b/compiler/testData/cli/jvm/inline/wrong.out @@ -1,24 +1,25 @@ Wrong value for inline option: 'wrong'. Should be 'on'/'off' or 'true'/'false' -Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments - -src [String] Source file or directory (allows many paths separated by the system path separator) - -jar [String] Resulting .jar file path - -output [String] Output directory path for .class files - -classpath [String] Paths where to find user class files - -annotations [String] Paths to external annotations - -includeRuntime [flag] Include Kotlin runtime in to resulting .jar - -noJdk [flag] Don't include Java runtime into classpath - -noStdlib [flag] Don't include Kotlin runtime into classpath - -noJdkAnnotations [flag] Don't include JDK external annotations into classpath - -notNullAssertions [flag] Generate not-null assertion after each invocation of method returning not-null - -notNullParamAssertions [flag] Generate not-null assertions on parameters of methods accessible from Java - -module [String] Path to the module file to compile - -script [flag] Evaluate the script file - -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off (default is on) - -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag - -verbose [flag] Enable verbose logging output - -version [flag] Display compiler version - -help (-h) [flag] Print a synopsis of standard options - -suppress [String] Suppress compiler messages by severity (warnings) - -printArgs [flag] Print command line arguments +Usage: kotlinc-jvm +where possible options include: + -src Source file or directory (allows many paths separated by the system path separator) + -jar Resulting .jar file path + -output Output directory path for .class files + -classpath Paths where to find user class files + -annotations Paths to external annotations + -includeRuntime Include Kotlin runtime in to resulting .jar + -noJdk Don't include Java runtime into classpath + -noStdlib Don't include Kotlin runtime into classpath + -noJdkAnnotations Don't include JDK external annotations into classpath + -notNullAssertions Generate not-null assertion after each invocation of method returning not-null + -notNullParamAssertions Generate not-null assertions on parameters of methods accessible from Java + -module Path to the module file to compile + -script Evaluate the script file + -kotlinHome Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery + -inline {on,off} Inlining mode (default is on) + -tags Demarcate each compilation message (error, warning, etc) with an open and close tag + -verbose Enable verbose logging output + -version Display compiler version + -help (-h) Print a synopsis of standard options + -suppress warnings Suppress all compiler warnings + -printArgs Print command line arguments INTERNAL_ERROR \ No newline at end of file diff --git a/compiler/testData/cli/jvm/wrongArgument.out b/compiler/testData/cli/jvm/wrongArgument.out index c8be2fd1b49..00e67039de6 100644 --- a/compiler/testData/cli/jvm/wrongArgument.out +++ b/compiler/testData/cli/jvm/wrongArgument.out @@ -1,24 +1,25 @@ Invalid argument: -wrongArgument -Usage: org.jetbrains.jet.cli.common.arguments.K2JVMCompilerArguments - -src [String] Source file or directory (allows many paths separated by the system path separator) - -jar [String] Resulting .jar file path - -output [String] Output directory path for .class files - -classpath [String] Paths where to find user class files - -annotations [String] Paths to external annotations - -includeRuntime [flag] Include Kotlin runtime in to resulting .jar - -noJdk [flag] Don't include Java runtime into classpath - -noStdlib [flag] Don't include Kotlin runtime into classpath - -noJdkAnnotations [flag] Don't include JDK external annotations into classpath - -notNullAssertions [flag] Generate not-null assertion after each invocation of method returning not-null - -notNullParamAssertions [flag] Generate not-null assertions on parameters of methods accessible from Java - -module [String] Path to the module file to compile - -script [flag] Evaluate the script file - -kotlinHome [String] Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery - -inline [String] Inlining mode: on/off (default is on) - -tags [flag] Demarcate each compilation message (error, warning, etc) with an open and close tag - -verbose [flag] Enable verbose logging output - -version [flag] Display compiler version - -help (-h) [flag] Print a synopsis of standard options - -suppress [String] Suppress compiler messages by severity (warnings) - -printArgs [flag] Print command line arguments +Usage: kotlinc-jvm +where possible options include: + -src Source file or directory (allows many paths separated by the system path separator) + -jar Resulting .jar file path + -output Output directory path for .class files + -classpath Paths where to find user class files + -annotations Paths to external annotations + -includeRuntime Include Kotlin runtime in to resulting .jar + -noJdk Don't include Java runtime into classpath + -noStdlib Don't include Kotlin runtime into classpath + -noJdkAnnotations Don't include JDK external annotations into classpath + -notNullAssertions Generate not-null assertion after each invocation of method returning not-null + -notNullParamAssertions Generate not-null assertions on parameters of methods accessible from Java + -module Path to the module file to compile + -script Evaluate the script file + -kotlinHome Path to Kotlin compiler home directory, used for annotations and runtime libraries discovery + -inline {on,off} Inlining mode (default is on) + -tags Demarcate each compilation message (error, warning, etc) with an open and close tag + -verbose Enable verbose logging output + -version Display compiler version + -help (-h) Print a synopsis of standard options + -suppress warnings Suppress all compiler warnings + -printArgs Print command line arguments INTERNAL_ERROR \ No newline at end of file From 71262bdf14c57cc237f410a7311cfa7aaed8f291 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Mon, 23 Jun 2014 17:40:22 +0400 Subject: [PATCH 15/20] Output to the current directory by default ("-output .") --- .../cli/jvm/compiler/CompileEnvironmentUtil.java | 5 +---- .../jvm/compiler/KotlinToJVMBytecodeCompiler.java | 15 ++++++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/CompileEnvironmentUtil.java b/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/CompileEnvironmentUtil.java index 67a98a0b7a4..0faf2ed84e6 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/CompileEnvironmentUtil.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/CompileEnvironmentUtil.java @@ -278,11 +278,8 @@ public class CompileEnvironmentUtil { if (jar != null) { writeToJar(jar, includeRuntime, mainClass, outputFiles); } - else if (outputDir != null) { - OutputUtilsPackage.writeAll(outputFiles, outputDir, messageCollector); - } else { - throw new CompileEnvironmentException("Output directory or jar file is not specified - no files will be saved to the disk"); + OutputUtilsPackage.writeAll(outputFiles, outputDir == null ? new File(".") : outputDir, messageCollector); } } diff --git a/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.java b/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.java index 1053bd84883..fa78cac7e1d 100644 --- a/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.java +++ b/compiler/cli/src/org/jetbrains/jet/cli/jvm/compiler/KotlinToJVMBytecodeCompiler.java @@ -22,6 +22,7 @@ import com.google.common.collect.Maps; import com.intellij.openapi.Disposable; import com.intellij.openapi.util.Disposer; import com.intellij.psi.PsiFile; +import com.intellij.util.ArrayUtil; import kotlin.Function0; import kotlin.Function1; import kotlin.Unit; @@ -91,12 +92,12 @@ public class KotlinToJVMBytecodeCompiler { } private static void writeOutput( - CompilerConfiguration configuration, - ClassFileFactory outputFiles, - File outputDir, - File jarPath, + @NotNull CompilerConfiguration configuration, + @NotNull ClassFileFactory outputFiles, + @Nullable File outputDir, + @Nullable File jarPath, boolean jarRuntime, - FqName mainClass + @Nullable FqName mainClass ) { MessageCollector messageCollector = configuration.get(CLIConfigurationKeys.MESSAGE_COLLECTOR_KEY, MessageCollector.NONE); CompileEnvironmentUtil.writeOutputToDirOrJar(jarPath, outputDir, jarRuntime, mainClass, outputFiles, messageCollector); @@ -192,7 +193,7 @@ public class KotlinToJVMBytecodeCompiler { } public static boolean compileBunchOfSources( - JetCoreEnvironment environment, + @NotNull JetCoreEnvironment environment, @Nullable File jar, @Nullable File outputDir, boolean includeRuntime @@ -223,7 +224,7 @@ public class KotlinToJVMBytecodeCompiler { if (scriptClass == null) return; try { - scriptClass.getConstructor(String[].class).newInstance(new Object[]{scriptArgs.toArray(new String[scriptArgs.size()])}); + scriptClass.getConstructor(String[].class).newInstance(new Object[] {ArrayUtil.toStringArray(scriptArgs)}); } catch (RuntimeException e) { throw e; From 3f51338320484acad72f5719bf834963cd48956a Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Wed, 25 Jun 2014 00:06:50 +0400 Subject: [PATCH 16/20] Save executable flag of kotlinc-jvm and kotlinc-js after zip archiving --- TeamCityBuild.xml | 7 ++++--- build.xml | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/TeamCityBuild.xml b/TeamCityBuild.xml index 1d48a1a3d3b..337877a8f23 100644 --- a/TeamCityBuild.xml +++ b/TeamCityBuild.xml @@ -94,12 +94,13 @@ - - + - + + + diff --git a/build.xml b/build.xml index 0ed757c5698..201ee4dd6a6 100644 --- a/build.xml +++ b/build.xml @@ -636,7 +636,9 @@ - + + + From 21be468e6cdfb086c839d1fbf7554e0e8326b710 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Wed, 25 Jun 2014 14:34:08 +0400 Subject: [PATCH 17/20] Pseudocode: Merge all access instructions into single file --- .../eval/AccessValueInstruction.kt | 40 -------------- .../eval/WriteValueInstruction.kt | 55 ------------------- ...ueInstruction.kt => accessInstructions.kt} | 49 ++++++++++++++++- 3 files changed, 47 insertions(+), 97 deletions(-) delete mode 100644 compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/AccessValueInstruction.kt delete mode 100644 compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/WriteValueInstruction.kt rename compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/{ReadValueInstruction.kt => accessInstructions.kt} (62%) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/AccessValueInstruction.kt b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/AccessValueInstruction.kt deleted file mode 100644 index 4a23137e339..00000000000 --- a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/AccessValueInstruction.kt +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2010-2014 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.jet.lang.cfg.pseudocode.instructions.eval - -import org.jetbrains.jet.lang.psi.JetElement -import org.jetbrains.jet.lang.cfg.pseudocode.PseudoValue -import org.jetbrains.jet.lang.cfg.pseudocode.instructions.LexicalScope -import org.jetbrains.jet.lang.cfg.pseudocode.instructions.InstructionWithNext -import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall -import org.jetbrains.jet.lang.descriptors.VariableDescriptor -import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverValue -import org.jetbrains.jet.lang.resolve.calls.tasks.ExplicitReceiverKind -import java.util.Collections - -public trait AccessTarget { - public data class Declaration(val descriptor: VariableDescriptor): AccessTarget - public data class Call(val resolvedCall: ResolvedCall<*>): AccessTarget - public object BlackBox: AccessTarget -} - -public abstract class AccessValueInstruction protected ( - element: JetElement, - lexicalScope: LexicalScope, - public val target: AccessTarget, - public override val receiverValues: Map -) : InstructionWithNext(element, lexicalScope), InstructionWithReceivers \ No newline at end of file diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/WriteValueInstruction.kt b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/WriteValueInstruction.kt deleted file mode 100644 index 43beda2653a..00000000000 --- a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/WriteValueInstruction.kt +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright 2010-2014 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.jet.lang.cfg.pseudocode.instructions.eval - -import org.jetbrains.jet.lang.psi.JetElement -import org.jetbrains.jet.lang.psi.JetNamedDeclaration -import java.util.Collections -import org.jetbrains.jet.lang.cfg.pseudocode.PseudoValue -import org.jetbrains.jet.lang.cfg.pseudocode.instructions.LexicalScope -import org.jetbrains.jet.lang.cfg.pseudocode.instructions.InstructionVisitor -import org.jetbrains.jet.lang.cfg.pseudocode.instructions.InstructionVisitorWithResult -import org.jetbrains.jet.lang.cfg.pseudocode.instructions.InstructionImpl -import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverValue - -public class WriteValueInstruction( - assignment: JetElement, - lexicalScope: LexicalScope, - target: AccessTarget, - receiverValues: Map, - public val lValue: JetElement, - public val rValue: PseudoValue -) : AccessValueInstruction(assignment, lexicalScope, target, receiverValues) { - override val inputValues: List - get() = receiverValues.keySet() + rValue - - override fun accept(visitor: InstructionVisitor) { - visitor.visitWriteValue(this) - } - - override fun accept(visitor: InstructionVisitorWithResult): R { - return visitor.visitWriteValue(this) - } - - override fun toString(): String { - val lhs = (lValue as? JetNamedDeclaration)?.getName() ?: render(lValue) - return "w($lhs|${inputValues.makeString(", ")})" - } - - override fun createCopy(): InstructionImpl = - WriteValueInstruction(element, lexicalScope, target, receiverValues, lValue, rValue) -} diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/ReadValueInstruction.kt b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/accessInstructions.kt similarity index 62% rename from compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/ReadValueInstruction.kt rename to compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/accessInstructions.kt index 4cb533a4ce8..c55a1a934dc 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/ReadValueInstruction.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/accessInstructions.kt @@ -17,13 +17,30 @@ package org.jetbrains.jet.lang.cfg.pseudocode.instructions.eval import org.jetbrains.jet.lang.psi.JetElement -import org.jetbrains.jet.lang.cfg.pseudocode.PseudoValueFactory import org.jetbrains.jet.lang.cfg.pseudocode.PseudoValue import org.jetbrains.jet.lang.cfg.pseudocode.instructions.LexicalScope +import org.jetbrains.jet.lang.cfg.pseudocode.instructions.InstructionWithNext +import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall +import org.jetbrains.jet.lang.descriptors.VariableDescriptor +import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverValue +import org.jetbrains.jet.lang.cfg.pseudocode.PseudoValueFactory import org.jetbrains.jet.lang.cfg.pseudocode.instructions.InstructionVisitor import org.jetbrains.jet.lang.cfg.pseudocode.instructions.InstructionVisitorWithResult import org.jetbrains.jet.lang.cfg.pseudocode.instructions.InstructionImpl -import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverValue +import org.jetbrains.jet.lang.psi.JetNamedDeclaration + +public trait AccessTarget { + public data class Declaration(val descriptor: VariableDescriptor): AccessTarget + public data class Call(val resolvedCall: ResolvedCall<*>): AccessTarget + public object BlackBox: AccessTarget +} + +public abstract class AccessValueInstruction protected ( + element: JetElement, + lexicalScope: LexicalScope, + public val target: AccessTarget, + public override val receiverValues: Map +) : InstructionWithNext(element, lexicalScope), InstructionWithReceivers public class ReadValueInstruction private ( element: JetElement, @@ -74,3 +91,31 @@ public class ReadValueInstruction private ( } } } + +public class WriteValueInstruction( + assignment: JetElement, + lexicalScope: LexicalScope, + target: AccessTarget, + receiverValues: Map, + public val lValue: JetElement, + public val rValue: PseudoValue +) : AccessValueInstruction(assignment, lexicalScope, target, receiverValues) { + override val inputValues: List + get() = receiverValues.keySet() + rValue + + override fun accept(visitor: InstructionVisitor) { + visitor.visitWriteValue(this) + } + + override fun accept(visitor: InstructionVisitorWithResult): R { + return visitor.visitWriteValue(this) + } + + override fun toString(): String { + val lhs = (lValue as? JetNamedDeclaration)?.getName() ?: render(lValue) + return "w($lhs|${inputValues.makeString(", ")})" + } + + override fun createCopy(): InstructionImpl = + WriteValueInstruction(element, lexicalScope, target, receiverValues, lValue, rValue) +} \ No newline at end of file From f226d99d3648afeca5ea7a72d38e0c668c06277f Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Wed, 25 Jun 2014 19:32:20 +0400 Subject: [PATCH 18/20] Pseudocode: Add valued instructions and unbound values to AbstractPseudoValueTest --- .../basic/IfWithUninitialized.values | 21 +- .../basic/InitializedNotDeclared.values | 3 +- .../basic/UsageInFunctionLiteral.values | 20 +- .../basic/VariablesInitialization.values | 23 +- .../cfg-variables/basic/VariablesUsage.values | 19 +- .../referenceToPropertyInitializer.values | 39 ++- .../bugs/varInitializationInIf.values | 16 +- .../bugs/varInitializationInIfInCycle.values | 21 +- .../lexicalScopes/doWhileScope.values | 14 +- .../lexicalScopes/forScope.values | 15 +- .../lexicalScopes/functionLiteralScope.values | 17 +- .../lexicalScopes/ifScope.values | 12 +- .../lexicalScopes/localClass.values | 13 +- .../lexicalScopes/localFunctionScope.values | 15 +- .../localFunctionScopeWithoutBody.values | 15 +- .../lexicalScopes/localObject.values | 10 +- .../lexicalScopes/objectLiteralScope.values | 12 +- .../propertyAccessorScope.values | 7 +- .../lexicalScopes/tryScope.values | 17 +- .../lexicalScopes/whileScope.values | 6 +- .../testData/cfg/arrays/ArrayAccess.values | 34 +- .../cfg/arrays/ArrayOfFunctions.values | 11 +- .../cfg/arrays/arrayAccessExpression.values | 13 +- compiler/testData/cfg/arrays/arrayInc.values | 7 +- compiler/testData/cfg/arrays/arraySet.values | 9 +- .../cfg/arrays/arraySetPlusAssign.values | 11 +- compiler/testData/cfg/basic/Basic.values | 64 ++-- .../testData/cfg/basic/ShortFunction.values | 2 +- .../testData/cfg/bugs/jumpToOuterScope.values | 8 +- .../cfg/controlStructures/Finally.values | 257 ++++++++------- .../controlStructures/FinallyTestCopy.values | 77 +++-- .../testData/cfg/controlStructures/For.values | 14 +- .../testData/cfg/controlStructures/If.values | 35 +- .../OnlyWhileInFunctionBody.values | 16 +- .../controlStructures/returnsInWhen.values | 6 +- .../cfg/conventions/bothReceivers.values | 9 +- .../testData/cfg/conventions/equals.values | 8 +- .../cfg/conventions/incrementAtTheEnd.values | 4 +- .../testData/cfg/conventions/invoke.values | 5 +- .../testData/cfg/conventions/notEqual.values | 8 +- .../testData/cfg/deadCode/DeadCode.values | 6 +- .../cfg/deadCode/returnInElvis.values | 6 +- .../cfg/deadCode/stringTemplate.values | 6 +- .../AnonymousInitializers.values | 8 +- .../unusedFunctionLiteral.values | 2 +- .../functions/FailFunction.values | 2 +- .../functions/typeParameter.values | 2 +- .../local/LocalDeclarations.values | 43 ++- .../local/ObjectExpression.values | 13 +- .../cfg/declarations/local/localClass.values | 4 +- .../declarations/local/localProperty.values | 2 +- .../multiDeclaration/MultiDecl.values | 13 +- .../multiDeclarationWithError.values | 9 +- .../properties/DelegatedProperty.values | 8 +- .../properties/backingFieldAccess.values | 5 +- .../backingFieldQualifiedWithThis.values | 12 +- .../cfg/expressions/Assignments.values | 48 +-- .../cfg/expressions/LazyBooleans.values | 62 ++-- .../expressions/ReturnFromExpression.values | 8 +- .../cfg/expressions/assignmentToThis.values | 3 +- .../chainedQualifiedExpression.values | 303 +++++++++--------- .../expressions/expressionAsFunction.values | 9 +- .../testData/cfg/expressions/incdec.values | 29 +- .../cfg/expressions/nothingExpr.values | 16 +- .../cfg/expressions/propertySafeCall.values | 9 +- .../qualifiedExpressionWithoutSelector.values | 7 +- .../cfg/expressions/thisExpression.values | 2 +- .../cfg/expressions/unresolvedCall.values | 9 +- .../cfg/expressions/unresolvedProperty.values | 9 +- .../unusedExpressionSimpleName.values | 5 +- .../DefaultValuesForArguments.values | 12 +- .../testData/cfg/tailCalls/finally.values | 2 +- .../cfg/tailCalls/finallyWithReturn.values | 2 +- compiler/testData/cfg/tailCalls/sum.values | 28 +- compiler/testData/cfg/tailCalls/try.values | 3 +- .../cfg/tailCalls/tryCatchFinally.values | 17 +- .../jet/cfg/AbstractPseudoValueTest.kt | 37 ++- 77 files changed, 897 insertions(+), 777 deletions(-) diff --git a/compiler/testData/cfg-variables/basic/IfWithUninitialized.values b/compiler/testData/cfg-variables/basic/IfWithUninitialized.values index 9e8d37ccb96..0e88483632f 100644 --- a/compiler/testData/cfg-variables/basic/IfWithUninitialized.values +++ b/compiler/testData/cfg-variables/basic/IfWithUninitialized.values @@ -9,18 +9,19 @@ fun foo() { } } --------------------- -1 : {<: Comparable} NEW() -2 : Int NEW() -1 < 2 : Boolean NEW(, ) -b : {<: Any?} NEW() -use(b) : * NEW() -{ use(b) } : * COPY -true : Boolean NEW() -if (1 < 2) { use(b) } else { b = true } : * COPY -{ val b: Boolean if (1 < 2) { use(b) } else { b = true } } : * COPY +1 : {<: Comparable} NEW: r(1) -> +2 : Int NEW: r(2) -> +1 < 2 : Boolean NEW: call(<, compareTo|, ) -> +b : {<: Any?} NEW: r(b) -> +use(b) : * NEW: call(use, use|) -> +{ use(b) } : * COPY +true : Boolean NEW: r(true) -> +if (1 < 2) { use(b) } else { b = true } : * COPY +{ val b: Boolean if (1 < 2) { use(b) } else { b = true } } : * COPY ===================== == use == fun use(vararg a: Any?) = a --------------------- -a : {<: Array} NEW() + : {<: Array} NEW: magic(vararg a: Any?) -> +a : {<: Array} NEW: r(a) -> ===================== diff --git a/compiler/testData/cfg-variables/basic/InitializedNotDeclared.values b/compiler/testData/cfg-variables/basic/InitializedNotDeclared.values index 6b99c7aaf59..f89bb34317c 100644 --- a/compiler/testData/cfg-variables/basic/InitializedNotDeclared.values +++ b/compiler/testData/cfg-variables/basic/InitializedNotDeclared.values @@ -6,5 +6,6 @@ class A { val x: Int } --------------------- -1 : Int NEW() + : A NEW: magic(x) -> +1 : Int NEW: r(1) -> ===================== diff --git a/compiler/testData/cfg-variables/basic/UsageInFunctionLiteral.values b/compiler/testData/cfg-variables/basic/UsageInFunctionLiteral.values index 4c2009adf92..ef1e6a6e02e 100644 --- a/compiler/testData/cfg-variables/basic/UsageInFunctionLiteral.values +++ b/compiler/testData/cfg-variables/basic/UsageInFunctionLiteral.values @@ -7,8 +7,8 @@ fun foo() { } } --------------------- -1 : Int NEW() -{ (x: Int) -> val y = x + a use(a) } : {<: (Int) -> Array} NEW() +1 : Int NEW: r(1) -> +{ (x: Int) -> val y = x + a use(a) } : {<: (Int) -> Array} NEW: r({ (x: Int) -> val y = x + a use(a) }) -> ===================== == anonymous_0 == { (x: Int) -> @@ -16,15 +16,17 @@ fun foo() { use(a) } --------------------- -x : Int NEW() -a : Int NEW() -x + a : Int NEW(, ) -a : {<: Any?} NEW() -use(a) : {<: Array} NEW() -val y = x + a use(a) : {<: Array} COPY + : Int NEW: magic(x: Int) -> +x : Int NEW: r(x) -> +a : Int NEW: r(a) -> +x + a : Int NEW: call(+, plus|, ) -> +a : {<: Any?} NEW: r(a) -> +use(a) : {<: Array} NEW: call(use, use|) -> +val y = x + a use(a) : {<: Array} COPY ===================== == use == fun use(vararg a: Any?) = a --------------------- -a : {<: Array} NEW() + : {<: Array} NEW: magic(vararg a: Any?) -> +a : {<: Array} NEW: r(a) -> ===================== diff --git a/compiler/testData/cfg-variables/basic/VariablesInitialization.values b/compiler/testData/cfg-variables/basic/VariablesInitialization.values index 99f30cf9766..1e348df8e2c 100644 --- a/compiler/testData/cfg-variables/basic/VariablesInitialization.values +++ b/compiler/testData/cfg-variables/basic/VariablesInitialization.values @@ -6,10 +6,10 @@ fun foo() { 42 } --------------------- -1 : Int NEW() -2 : Int NEW() -42 : * NEW() -{ val a = 1 val b: Int b = 2 42 } : * COPY +1 : Int NEW: r(1) -> +2 : Int NEW: r(2) -> +42 : * NEW: r(42) -> +{ val a = 1 val b: Int b = 2 42 } : * COPY ===================== == bar == fun bar(foo: Foo) { @@ -18,13 +18,14 @@ fun bar(foo: Foo) { 42 } --------------------- -foo : {<: Foo} NEW() -c : * NEW() -foo.c : * COPY -foo : {<: Foo} NEW() -2 : Int NEW() -42 : * NEW() -{ foo.c foo.c = 2 42 } : * COPY + : {<: Foo} NEW: magic(foo: Foo) -> +foo : {<: Foo} NEW: r(foo) -> +c : * NEW: r(c|) -> +foo.c : * COPY +foo : {<: Foo} NEW: r(foo) -> +2 : Int NEW: r(2) -> +42 : * NEW: r(42) -> +{ foo.c foo.c = 2 42 } : * COPY ===================== == Foo == trait Foo { diff --git a/compiler/testData/cfg-variables/basic/VariablesUsage.values b/compiler/testData/cfg-variables/basic/VariablesUsage.values index 99496514298..92570f6a36e 100644 --- a/compiler/testData/cfg-variables/basic/VariablesUsage.values +++ b/compiler/testData/cfg-variables/basic/VariablesUsage.values @@ -6,13 +6,13 @@ fun foo() { use(a) } --------------------- -1 : Int NEW() -a : Int NEW() -use(a) : * NEW() -2 : Int NEW() -a : Int NEW() -use(a) : * NEW() -{ var a = 1 use(a) a = 2 use(a) } : * COPY +1 : Int NEW: r(1) -> +a : Int NEW: r(a) -> +use(a) : * NEW: call(use, use|) -> +2 : Int NEW: r(2) -> +a : Int NEW: r(a) -> +use(a) : * NEW: call(use, use|) -> +{ var a = 1 use(a) a = 2 use(a) } : * COPY ===================== == bar == fun bar() { @@ -20,10 +20,11 @@ fun bar() { b = 3 } --------------------- -3 : Int NEW() +3 : Int NEW: r(3) -> ===================== == use == fun use(a: Int) = a --------------------- -a : Int NEW() + : Int NEW: magic(a: Int) -> +a : Int NEW: r(a) -> ===================== diff --git a/compiler/testData/cfg-variables/bugs/referenceToPropertyInitializer.values b/compiler/testData/cfg-variables/bugs/referenceToPropertyInitializer.values index 2c25e090ff8..c877aa87b51 100644 --- a/compiler/testData/cfg-variables/bugs/referenceToPropertyInitializer.values +++ b/compiler/testData/cfg-variables/bugs/referenceToPropertyInitializer.values @@ -5,25 +5,28 @@ class TestFunctionLiteral { } } --------------------- -{ (x: Int) -> sum(x - 1) + x } : {<: (Int) -> Int} NEW() +{ (x: Int) -> sum(x - 1) + x } : {<: (Int) -> Int} NEW: r({ (x: Int) -> sum(x - 1) + x }) -> ===================== == anonymous_0 == { (x: Int) -> sum(x - 1) + x } --------------------- -sum : {<: (Int) -> Int} NEW() -x : Int NEW() -1 : Int NEW() -x - 1 : Int NEW(, ) -sum(x - 1) : Int NEW(, ) -x : Int NEW() -sum(x - 1) + x : Int NEW(, ) -sum(x - 1) + x : Int COPY + : Int NEW: magic(x: Int) -> + : TestFunctionLiteral NEW: magic(sum) -> +sum : {<: (Int) -> Int} NEW: r(sum|) -> +x : Int NEW: r(x) -> +1 : Int NEW: r(1) -> +x - 1 : Int NEW: call(-, minus|, ) -> +sum(x - 1) : Int NEW: call(sum, invoke|, ) -> +x : Int NEW: r(x) -> +sum(x - 1) + x : Int NEW: call(+, plus|, ) -> +sum(x - 1) + x : Int COPY ===================== == A == open class A(val a: A) --------------------- + : {<: A} NEW: magic(val a: A) -> ===================== == TestObjectLiteral == class TestObjectLiteral { @@ -37,23 +40,27 @@ class TestObjectLiteral { } } --------------------- -obj : * NEW() -obj : {<: A} NEW() -object: A(obj) { { val x = obj } fun foo() { val y = obj } } : {<: A} NEW() + : TestObjectLiteral NEW: magic(obj) -> + : TestObjectLiteral NEW: magic(obj) -> +obj : * NEW: r(obj|) -> +obj : {<: A} NEW: r(obj|) -> +object: A(obj) { { val x = obj } fun foo() { val y = obj } } : {<: A} NEW: r(object: A(obj) { { val x = obj } fun foo() { val y = obj } }) -> ===================== == foo == fun foo() { val y = obj } --------------------- -obj : {<: A} NEW() + : TestObjectLiteral NEW: magic(obj) -> +obj : {<: A} NEW: r(obj|) -> ===================== == TestOther == class TestOther { val x: Int = x + 1 } --------------------- -x : Int NEW() -1 : Int NEW() -x + 1 : Int NEW(, ) + : TestOther NEW: magic(x) -> +x : Int NEW: r(x|) -> +1 : Int NEW: r(1) -> +x + 1 : Int NEW: call(+, plus|, ) -> ===================== diff --git a/compiler/testData/cfg-variables/bugs/varInitializationInIf.values b/compiler/testData/cfg-variables/bugs/varInitializationInIf.values index e14fe8f08f1..ecec75f8896 100644 --- a/compiler/testData/cfg-variables/bugs/varInitializationInIf.values +++ b/compiler/testData/cfg-variables/bugs/varInitializationInIf.values @@ -10,12 +10,12 @@ fun foo() { use(b) } --------------------- -1 : {<: Comparable} NEW() -2 : Int NEW() -1 < 2 : Boolean NEW(, ) -false : Boolean NEW() -true : Boolean NEW() -b : * NEW() -use(b) : * NEW() -{ val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) } : * COPY +1 : {<: Comparable} NEW: r(1) -> +2 : Int NEW: r(2) -> +1 < 2 : Boolean NEW: call(<, compareTo|, ) -> +false : Boolean NEW: r(false) -> +true : Boolean NEW: r(true) -> +b : * NEW: r(b) -> +use(b) : * NEW: magic(use(b)|) -> +{ val b: Boolean if (1 < 2) { b = false } else { b = true } use(b) } : * COPY ===================== diff --git a/compiler/testData/cfg-variables/bugs/varInitializationInIfInCycle.values b/compiler/testData/cfg-variables/bugs/varInitializationInIfInCycle.values index 4b4eee75d7b..4893c4066c2 100644 --- a/compiler/testData/cfg-variables/bugs/varInitializationInIfInCycle.values +++ b/compiler/testData/cfg-variables/bugs/varInitializationInIfInCycle.values @@ -13,17 +13,20 @@ fun foo(numbers: Collection) { } } --------------------- -numbers : {<: Iterable} NEW() -1 : {<: Comparable} NEW() -2 : Int NEW() -1 < 2 : Boolean NEW(, ) -false : Boolean NEW() -true : Boolean NEW() -b : {<: Any?} NEW() -use(b) : * NEW() + : {<: Collection} NEW: magic(numbers: Collection) -> + : Int NEW: magic(numbers|) -> +numbers : {<: Iterable} NEW: r(numbers) -> +1 : {<: Comparable} NEW: r(1) -> +2 : Int NEW: r(2) -> +1 < 2 : Boolean NEW: call(<, compareTo|, ) -> +false : Boolean NEW: r(false) -> +true : Boolean NEW: r(true) -> +b : {<: Any?} NEW: r(b) -> +use(b) : * NEW: call(use, use|) -> ===================== == use == fun use(vararg a: Any?) = a --------------------- -a : {<: Array} NEW() + : {<: Array} NEW: magic(vararg a: Any?) -> +a : {<: Array} NEW: r(a) -> ===================== diff --git a/compiler/testData/cfg-variables/lexicalScopes/doWhileScope.values b/compiler/testData/cfg-variables/lexicalScopes/doWhileScope.values index b54a25d7dbe..6d27274992c 100644 --- a/compiler/testData/cfg-variables/lexicalScopes/doWhileScope.values +++ b/compiler/testData/cfg-variables/lexicalScopes/doWhileScope.values @@ -7,11 +7,11 @@ fun foo() { "after" } --------------------- -"before" : * NEW() -2 : Int NEW() -a : {<: Comparable} NEW() -0 : Int NEW() -a > 0 : Boolean NEW(, ) -"after" : * NEW() -{ "before" do { var a = 2 } while (a > 0) "after" } : * COPY +"before" : * NEW: r("before") -> +2 : Int NEW: r(2) -> +a : {<: Comparable} NEW: r(a) -> +0 : Int NEW: r(0) -> +a > 0 : Boolean NEW: call(>, compareTo|, ) -> +"after" : * NEW: r("after") -> +{ "before" do { var a = 2 } while (a > 0) "after" } : * COPY ===================== diff --git a/compiler/testData/cfg-variables/lexicalScopes/forScope.values b/compiler/testData/cfg-variables/lexicalScopes/forScope.values index 8bcf01b3d9b..b952b64e1e4 100644 --- a/compiler/testData/cfg-variables/lexicalScopes/forScope.values +++ b/compiler/testData/cfg-variables/lexicalScopes/forScope.values @@ -7,11 +7,12 @@ fun foo() { "after" } --------------------- -"before" : * NEW() -1 : Int NEW() -10 : Int NEW() -1..10 : {<: Iterable} NEW(, ) -i : Int NEW() -"after" : * NEW() -{ "before" for (i in 1..10) { val a = i } "after" } : * COPY + : Int NEW: magic(1..10|) -> +"before" : * NEW: r("before") -> +1 : Int NEW: r(1) -> +10 : Int NEW: r(10) -> +1..10 : {<: Iterable} NEW: call(.., rangeTo|, ) -> +i : Int NEW: r(i) -> +"after" : * NEW: r("after") -> +{ "before" for (i in 1..10) { val a = i } "after" } : * COPY ===================== diff --git a/compiler/testData/cfg-variables/lexicalScopes/functionLiteralScope.values b/compiler/testData/cfg-variables/lexicalScopes/functionLiteralScope.values index 94790e1fd76..f61f02e1741 100644 --- a/compiler/testData/cfg-variables/lexicalScopes/functionLiteralScope.values +++ b/compiler/testData/cfg-variables/lexicalScopes/functionLiteralScope.values @@ -8,18 +8,19 @@ fun foo() { "after" } --------------------- -"before" : * NEW() -1 : Int NEW() -{ (x: Int) -> val a = x + b } : {<: (Int) -> Unit} NEW() -"after" : * NEW() -{ "before" val b = 1 val f = { (x: Int) -> val a = x + b } "after" } : * COPY +"before" : * NEW: r("before") -> +1 : Int NEW: r(1) -> +{ (x: Int) -> val a = x + b } : {<: (Int) -> Unit} NEW: r({ (x: Int) -> val a = x + b }) -> +"after" : * NEW: r("after") -> +{ "before" val b = 1 val f = { (x: Int) -> val a = x + b } "after" } : * COPY ===================== == anonymous_0 == { (x: Int) -> val a = x + b } --------------------- -x : Int NEW() -b : Int NEW() -x + b : Int NEW(, ) + : Int NEW: magic(x: Int) -> +x : Int NEW: r(x) -> +b : Int NEW: r(b) -> +x + b : Int NEW: call(+, plus|, ) -> ===================== diff --git a/compiler/testData/cfg-variables/lexicalScopes/ifScope.values b/compiler/testData/cfg-variables/lexicalScopes/ifScope.values index 2b5ab5da777..a44dfb6f42b 100644 --- a/compiler/testData/cfg-variables/lexicalScopes/ifScope.values +++ b/compiler/testData/cfg-variables/lexicalScopes/ifScope.values @@ -10,10 +10,10 @@ fun foo() { "after" } --------------------- -"before" : * NEW() -true : Boolean NEW() -1 : Int NEW() -2 : Int NEW() -"after" : * NEW() -{ "before" if (true) { val a = 1 } else { val b = 2 } "after" } : * COPY +"before" : * NEW: r("before") -> +true : Boolean NEW: r(true) -> +1 : Int NEW: r(1) -> +2 : Int NEW: r(2) -> +"after" : * NEW: r("after") -> +{ "before" if (true) { val a = 1 } else { val b = 2 } "after" } : * COPY ===================== diff --git a/compiler/testData/cfg-variables/lexicalScopes/localClass.values b/compiler/testData/cfg-variables/lexicalScopes/localClass.values index 6787b010d9d..ed7081c546c 100644 --- a/compiler/testData/cfg-variables/lexicalScopes/localClass.values +++ b/compiler/testData/cfg-variables/lexicalScopes/localClass.values @@ -12,15 +12,18 @@ fun foo() { "after" } --------------------- -"before" : * NEW() -x : Int NEW() -"after" : * NEW() -{ "before" class A(val x: Int) { { val a = x } fun foo() { val b = x } } "after" } : * COPY + : Int NEW: magic(val x: Int) -> + : A NEW: magic(x) -> +"before" : * NEW: r("before") -> +x : Int NEW: r(x|) -> +"after" : * NEW: r("after") -> +{ "before" class A(val x: Int) { { val a = x } fun foo() { val b = x } } "after" } : * COPY ===================== == foo == fun foo() { val b = x } --------------------- -x : Int NEW() + : A NEW: magic(x) -> +x : Int NEW: r(x|) -> ===================== diff --git a/compiler/testData/cfg-variables/lexicalScopes/localFunctionScope.values b/compiler/testData/cfg-variables/lexicalScopes/localFunctionScope.values index 0cd7d1c50ea..463862cd7a5 100644 --- a/compiler/testData/cfg-variables/lexicalScopes/localFunctionScope.values +++ b/compiler/testData/cfg-variables/lexicalScopes/localFunctionScope.values @@ -8,17 +8,18 @@ fun foo() { "after" } --------------------- -"before" : * NEW() -1 : Int NEW() -"after" : * NEW() -{ "before" val b = 1 fun local(x: Int) { val a = x + b } "after" } : * COPY +"before" : * NEW: r("before") -> +1 : Int NEW: r(1) -> +"after" : * NEW: r("after") -> +{ "before" val b = 1 fun local(x: Int) { val a = x + b } "after" } : * COPY ===================== == local == fun local(x: Int) { val a = x + b } --------------------- -x : Int NEW() -b : Int NEW() -x + b : Int NEW(, ) + : Int NEW: magic(x: Int) -> +x : Int NEW: r(x) -> +b : Int NEW: r(b) -> +x + b : Int NEW: call(+, plus|, ) -> ===================== diff --git a/compiler/testData/cfg-variables/lexicalScopes/localFunctionScopeWithoutBody.values b/compiler/testData/cfg-variables/lexicalScopes/localFunctionScopeWithoutBody.values index b70862c6513..e94e97e60da 100644 --- a/compiler/testData/cfg-variables/lexicalScopes/localFunctionScopeWithoutBody.values +++ b/compiler/testData/cfg-variables/lexicalScopes/localFunctionScopeWithoutBody.values @@ -6,15 +6,16 @@ fun foo() { "after" } --------------------- -"before" : * NEW() -1 : Int NEW() -"after" : * NEW() -{ "before" val b = 1 fun local(x: Int) = x + b "after" } : * COPY +"before" : * NEW: r("before") -> +1 : Int NEW: r(1) -> +"after" : * NEW: r("after") -> +{ "before" val b = 1 fun local(x: Int) = x + b "after" } : * COPY ===================== == local == fun local(x: Int) = x + b --------------------- -x : Int NEW() -b : Int NEW() -x + b : Int NEW(, ) + : Int NEW: magic(x: Int) -> +x : Int NEW: r(x) -> +b : Int NEW: r(b) -> +x + b : Int NEW: call(+, plus|, ) -> ===================== diff --git a/compiler/testData/cfg-variables/lexicalScopes/localObject.values b/compiler/testData/cfg-variables/lexicalScopes/localObject.values index 0c9ae1d8ecf..f1d5201cf33 100644 --- a/compiler/testData/cfg-variables/lexicalScopes/localObject.values +++ b/compiler/testData/cfg-variables/lexicalScopes/localObject.values @@ -12,15 +12,15 @@ fun foo() { "after" } --------------------- -"before" : * NEW() -1 : Int NEW() -"after" : * NEW() -{ "before" object A { { val a = 1 } fun foo() { val b = 2 } } "after" } : * COPY +"before" : * NEW: r("before") -> +1 : Int NEW: r(1) -> +"after" : * NEW: r("after") -> +{ "before" object A { { val a = 1 } fun foo() { val b = 2 } } "after" } : * COPY ===================== == foo == fun foo() { val b = 2 } --------------------- -2 : Int NEW() +2 : Int NEW: r(2) -> ===================== diff --git a/compiler/testData/cfg-variables/lexicalScopes/objectLiteralScope.values b/compiler/testData/cfg-variables/lexicalScopes/objectLiteralScope.values index 0fc6f4bc18c..d27c79aa726 100644 --- a/compiler/testData/cfg-variables/lexicalScopes/objectLiteralScope.values +++ b/compiler/testData/cfg-variables/lexicalScopes/objectLiteralScope.values @@ -12,16 +12,16 @@ fun foo() { "after" } --------------------- -"before" : * NEW() -1 : Int NEW() -object { { val x = 1 } fun foo() { val a = 2 } } : NEW() -"after" : * NEW() -{ "before" val bar = object { { val x = 1 } fun foo() { val a = 2 } } "after" } : * COPY +"before" : * NEW: r("before") -> +1 : Int NEW: r(1) -> +object { { val x = 1 } fun foo() { val a = 2 } } : NEW: r(object { { val x = 1 } fun foo() { val a = 2 } }) -> +"after" : * NEW: r("after") -> +{ "before" val bar = object { { val x = 1 } fun foo() { val a = 2 } } "after" } : * COPY ===================== == foo == fun foo() { val a = 2 } --------------------- -2 : Int NEW() +2 : Int NEW: r(2) -> ===================== diff --git a/compiler/testData/cfg-variables/lexicalScopes/propertyAccessorScope.values b/compiler/testData/cfg-variables/lexicalScopes/propertyAccessorScope.values index a38dc2dc87b..8071beeb5a4 100644 --- a/compiler/testData/cfg-variables/lexicalScopes/propertyAccessorScope.values +++ b/compiler/testData/cfg-variables/lexicalScopes/propertyAccessorScope.values @@ -17,12 +17,15 @@ get() { return $a } --------------------- -$a : Int NEW() + : A NEW: magic($a) -> +$a : Int NEW: r($a|) -> ===================== == set_a == set(v: Int) { $a = v } --------------------- -v : Int NEW() + : Int NEW: magic(v: Int) -> + : A NEW: magic($a) -> +v : Int NEW: r(v) -> ===================== diff --git a/compiler/testData/cfg-variables/lexicalScopes/tryScope.values b/compiler/testData/cfg-variables/lexicalScopes/tryScope.values index ce7d64a84c6..e5b41213573 100644 --- a/compiler/testData/cfg-variables/lexicalScopes/tryScope.values +++ b/compiler/testData/cfg-variables/lexicalScopes/tryScope.values @@ -13,12 +13,13 @@ fun foo() { "after" } --------------------- -"before" : * NEW() -foo() : * NEW() -{ foo() } : * COPY -e : {<: Exception} NEW() -1 : Int NEW() -try { foo() } catch (e: Exception) { val a = e } finally { val a = 1 } : * COPY -"after" : * NEW() -{ "before" try { foo() } catch (e: Exception) { val a = e } finally { val a = 1 } "after" } : * COPY + : {<: Exception} NEW: magic(e: Exception) -> +"before" : * NEW: r("before") -> +foo() : * NEW: call(foo, foo) -> +{ foo() } : * COPY +e : {<: Exception} NEW: r(e) -> +1 : Int NEW: r(1) -> +try { foo() } catch (e: Exception) { val a = e } finally { val a = 1 } : * COPY +"after" : * NEW: r("after") -> +{ "before" try { foo() } catch (e: Exception) { val a = e } finally { val a = 1 } "after" } : * COPY ===================== diff --git a/compiler/testData/cfg-variables/lexicalScopes/whileScope.values b/compiler/testData/cfg-variables/lexicalScopes/whileScope.values index a8c0d80a31a..23af85b6d26 100644 --- a/compiler/testData/cfg-variables/lexicalScopes/whileScope.values +++ b/compiler/testData/cfg-variables/lexicalScopes/whileScope.values @@ -7,8 +7,8 @@ fun foo() { "after" } --------------------- -"before" : * NEW() -true : * NEW() -"after" : * NEW() +"before" : * NEW: r("before") -> +true : * NEW: r(true) -> +"after" : * NEW: r("after") -> { "before" while (true) { val a: Int } "after" } : * COPY ===================== diff --git a/compiler/testData/cfg/arrays/ArrayAccess.values b/compiler/testData/cfg/arrays/ArrayAccess.values index c6a7315e367..5d5de2ce4ef 100644 --- a/compiler/testData/cfg/arrays/ArrayAccess.values +++ b/compiler/testData/cfg/arrays/ArrayAccess.values @@ -9,21 +9,21 @@ fun foo() { a[10] += 1 } --------------------- -Array : {<: Array} NEW() -3 : * NEW() -a : {<: Array} NEW() -10 : Int NEW() -4 : Int NEW() -a[10] = 4 : * NEW(, , ) -2 : * NEW() -a : {<: Array} NEW() -10 : Int NEW() -a[10] : * NEW(, ) -100 : * NEW() -a : {<: Array} NEW() -10 : Int NEW() -a[10] : Int NEW(, ) -1 : Int NEW() -a[10] += 1 : * NEW(, , ) -{ val a = Array 3 a[10] = 4 2 a[10] 100 a[10] += 1 } : * COPY +Array : {<: Array} NEW: call(Array, ) -> +3 : * NEW: r(3) -> +a : {<: Array} NEW: r(a) -> +10 : Int NEW: r(10) -> +4 : Int NEW: r(4) -> +a[10] = 4 : * NEW: call(a[10] = 4, set|, , ) -> +2 : * NEW: r(2) -> +a : {<: Array} NEW: r(a) -> +10 : Int NEW: r(10) -> +a[10] : * NEW: call(a[10], get|, ) -> +100 : * NEW: r(100) -> +a : {<: Array} NEW: r(a) -> +10 : Int NEW: r(10) -> +a[10] : Int NEW: call(a[10], get|, ) -> +1 : Int NEW: r(1) -> +a[10] += 1 : * NEW: call(a[10] += 1, set|, , ) -> +{ val a = Array 3 a[10] = 4 2 a[10] 100 a[10] += 1 } : * COPY ===================== diff --git a/compiler/testData/cfg/arrays/ArrayOfFunctions.values b/compiler/testData/cfg/arrays/ArrayOfFunctions.values index 2fd1a0238ac..b6519f642b4 100644 --- a/compiler/testData/cfg/arrays/ArrayOfFunctions.values +++ b/compiler/testData/cfg/arrays/ArrayOfFunctions.values @@ -3,10 +3,11 @@ fun test(array: Array<(Int)->Unit>) { array[11](3) } --------------------- -array : {<: Array<(Int) -> Unit>} NEW() -11 : Int NEW() -array[11] : {<: (Int) -> Unit} NEW(, ) -3 : Int NEW() -array[11](3) : * NEW(, ) + : {<: Array<(Int) -> Unit>} NEW: magic(array: Array<(Int)->Unit>) -> +array : {<: Array<(Int) -> Unit>} NEW: r(array) -> +11 : Int NEW: r(11) -> +array[11] : {<: (Int) -> Unit} NEW: call(array[11], get|, ) -> +3 : Int NEW: r(3) -> +array[11](3) : * NEW: call(array[11], invoke|, ) -> { array[11](3) } : * COPY ===================== diff --git a/compiler/testData/cfg/arrays/arrayAccessExpression.values b/compiler/testData/cfg/arrays/arrayAccessExpression.values index 0328f66872c..7af20f98cbc 100644 --- a/compiler/testData/cfg/arrays/arrayAccessExpression.values +++ b/compiler/testData/cfg/arrays/arrayAccessExpression.values @@ -13,10 +13,11 @@ fun test(ab: Ab) { ab.getArray()[1] } --------------------- -ab : {<: Ab} NEW() -getArray() : {<: Array} NEW() -ab.getArray() : {<: Array} COPY -1 : Int NEW() -ab.getArray()[1] : * NEW(, ) -{ ab.getArray()[1] } : * COPY + : {<: Ab} NEW: magic(ab: Ab) -> +ab : {<: Ab} NEW: r(ab) -> +getArray() : {<: Array} NEW: call(getArray, getArray|) -> +ab.getArray() : {<: Array} COPY +1 : Int NEW: r(1) -> +ab.getArray()[1] : * NEW: call(ab.getArray()[1], get|, ) -> +{ ab.getArray()[1] } : * COPY ===================== diff --git a/compiler/testData/cfg/arrays/arrayInc.values b/compiler/testData/cfg/arrays/arrayInc.values index c2a550bd58b..c4c5007e9fb 100644 --- a/compiler/testData/cfg/arrays/arrayInc.values +++ b/compiler/testData/cfg/arrays/arrayInc.values @@ -3,9 +3,10 @@ fun foo(a: Array) { a[0]++ } --------------------- -a : {<: Array} NEW() -0 : Int NEW() -a[0] : Int NEW(, ) + : {<: Array} NEW: magic(a: Array) -> +a : {<: Array} NEW: r(a) -> +0 : Int NEW: r(0) -> +a[0] : Int NEW: call(a[0], get|, ) -> a[0]++ : Int COPY { a[0]++ } : Int COPY ===================== diff --git a/compiler/testData/cfg/arrays/arraySet.values b/compiler/testData/cfg/arrays/arraySet.values index 15ca1d7a79f..222da0eb858 100644 --- a/compiler/testData/cfg/arrays/arraySet.values +++ b/compiler/testData/cfg/arrays/arraySet.values @@ -3,9 +3,10 @@ fun foo(a: Array) { a[1] = 2 } --------------------- -a : {<: Array} NEW() -1 : Int NEW() -2 : Int NEW() -a[1] = 2 : * NEW(, , ) + : {<: Array} NEW: magic(a: Array) -> +a : {<: Array} NEW: r(a) -> +1 : Int NEW: r(1) -> +2 : Int NEW: r(2) -> +a[1] = 2 : * NEW: call(a[1] = 2, set|, , ) -> { a[1] = 2 } : * COPY ===================== diff --git a/compiler/testData/cfg/arrays/arraySetPlusAssign.values b/compiler/testData/cfg/arrays/arraySetPlusAssign.values index e25b40da814..8fd65f4825c 100644 --- a/compiler/testData/cfg/arrays/arraySetPlusAssign.values +++ b/compiler/testData/cfg/arrays/arraySetPlusAssign.values @@ -3,10 +3,11 @@ fun foo(a: Array) { a[0] += 1 } --------------------- -a : {<: Array} NEW() -0 : Int NEW() -a[0] : Int NEW(, ) -1 : Int NEW() -a[0] += 1 : * NEW(, , ) + : {<: Array} NEW: magic(a: Array) -> +a : {<: Array} NEW: r(a) -> +0 : Int NEW: r(0) -> +a[0] : Int NEW: call(a[0], get|, ) -> +1 : Int NEW: r(1) -> +a[0] += 1 : * NEW: call(a[0] += 1, set|, , ) -> { a[0] += 1 } : * COPY ===================== diff --git a/compiler/testData/cfg/basic/Basic.values b/compiler/testData/cfg/basic/Basic.values index 2b597aef89a..a579da36221 100644 --- a/compiler/testData/cfg/basic/Basic.values +++ b/compiler/testData/cfg/basic/Basic.values @@ -17,44 +17,47 @@ fun f(a : Boolean) : Unit { } --------------------- -1 : * NEW() -a : * NEW() -2 : {<: Number} NEW() -toLong() : * NEW() -2.toLong() : * COPY -a : Boolean NEW() -3 : Int NEW() -foo(a, 3) : * NEW(, ) -genfun() : * NEW() -{1} : {<: () -> Any} NEW() -flfun {1} : * NEW() -3 : OR{{<: Any}, {<: Any}} NEW() -4 : {<: Any?} NEW() -equals(4) : * NEW(, ) -3.equals(4) : * COPY -3 : OR{{<: Any}, {<: Any}} NEW() -4 : {<: Any?} NEW() -3 equals 4 : * NEW(, ) -1 : Int NEW() -2 : Int NEW() -1 + 2 : * NEW(, ) -a : Boolean NEW() -true : Boolean NEW() -a && true : * NEW(, ) -a : Boolean NEW() -false : Boolean NEW() -a || false : * NEW(, ) -{ 1 a 2.toLong() foo(a, 3) genfun() flfun {1} 3.equals(4) 3 equals 4 1 + 2 a && true a || false } : * COPY + : Boolean NEW: magic(a : Boolean) -> +1 : * NEW: r(1) -> +a : * NEW: r(a) -> +2 : {<: Number} NEW: r(2) -> +toLong() : * NEW: call(toLong, toLong|) -> +2.toLong() : * COPY +a : Boolean NEW: r(a) -> +3 : Int NEW: r(3) -> +foo(a, 3) : * NEW: call(foo, foo|, ) -> +genfun() : * NEW: call(genfun, genfun) -> +{1} : {<: () -> Any} NEW: r({1}) -> +flfun {1} : * NEW: call(flfun, flfun|) -> +3 : OR{{<: Any}, {<: Any}} NEW: r(3) -> +4 : {<: Any?} NEW: r(4) -> +equals(4) : * NEW: call(equals, equals|, ) -> +3.equals(4) : * COPY +3 : OR{{<: Any}, {<: Any}} NEW: r(3) -> +4 : {<: Any?} NEW: r(4) -> +3 equals 4 : * NEW: call(equals, equals|, ) -> +1 : Int NEW: r(1) -> +2 : Int NEW: r(2) -> +1 + 2 : * NEW: call(+, plus|, ) -> +a : Boolean NEW: r(a) -> +true : Boolean NEW: r(true) -> +a && true : * NEW: magic(a && true|, ) -> +a : Boolean NEW: r(a) -> +false : Boolean NEW: r(false) -> +a || false : * NEW: magic(a || false|, ) -> +{ 1 a 2.toLong() foo(a, 3) genfun() flfun {1} 3.equals(4) 3 equals 4 1 + 2 a && true a || false } : * COPY ===================== == anonymous_0 == {1} --------------------- -1 : Int NEW() -1 : Int COPY +1 : Int NEW: r(1) -> +1 : Int COPY ===================== == foo == fun foo(a : Boolean, b : Int) : Unit {} --------------------- + : Boolean NEW: magic(a : Boolean) -> + : Int NEW: magic(b : Int) -> ===================== == genfun == fun genfun() : Unit {} @@ -63,4 +66,5 @@ fun genfun() : Unit {} == flfun == fun flfun(f : () -> Any) : Unit {} --------------------- + : {<: () -> Any} NEW: magic(f : () -> Any) -> ===================== diff --git a/compiler/testData/cfg/basic/ShortFunction.values b/compiler/testData/cfg/basic/ShortFunction.values index f2c7d17510e..d42b5802312 100644 --- a/compiler/testData/cfg/basic/ShortFunction.values +++ b/compiler/testData/cfg/basic/ShortFunction.values @@ -1,5 +1,5 @@ == short == fun short() = 1 --------------------- -1 : Int NEW() +1 : Int NEW: r(1) -> ===================== diff --git a/compiler/testData/cfg/bugs/jumpToOuterScope.values b/compiler/testData/cfg/bugs/jumpToOuterScope.values index f58075297ea..4960adf6fe6 100644 --- a/compiler/testData/cfg/bugs/jumpToOuterScope.values +++ b/compiler/testData/cfg/bugs/jumpToOuterScope.values @@ -7,9 +7,11 @@ fun foo(c: Collection) { } } --------------------- -c : {<: Iterable} NEW() -{ break } : * NEW() -{ { break } } : * COPY + : {<: Collection} NEW: magic(c: Collection) -> + : Int NEW: magic(c|) -> +c : {<: Iterable} NEW: r(c) -> +{ break } : * NEW: r({ break }) -> +{ { break } } : * COPY ===================== == anonymous_0 == { diff --git a/compiler/testData/cfg/controlStructures/Finally.values b/compiler/testData/cfg/controlStructures/Finally.values index 8765ede1b36..2e913a861a1 100644 --- a/compiler/testData/cfg/controlStructures/Finally.values +++ b/compiler/testData/cfg/controlStructures/Finally.values @@ -7,12 +7,12 @@ fun t1() { } } --------------------- -1 : * NEW() -{ 1 } : * COPY -2 : * NEW() -{ 2 } : * COPY -try { 1 } finally { 2 } : * COPY -{ try { 1 } finally { 2 } } : * COPY +1 : * NEW: r(1) -> +{ 1 } : * COPY +2 : * NEW: r(2) -> +{ 2 } : * COPY +try { 1 } finally { 2 } : * COPY +{ try { 1 } finally { 2 } } : * COPY ===================== == t2 == fun t2() { @@ -26,12 +26,12 @@ fun t2() { } } --------------------- -1 : * NEW() -2 : {<: Comparable} NEW() -3 : Int NEW() -2 > 3 : Boolean NEW(, ) -2 : * NEW() -{ 2 } : * COPY +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(>, compareTo|, ) -> +2 : * NEW: r(2) -> +{ 2 } : * COPY ===================== == t3 == fun t3() { @@ -47,14 +47,14 @@ fun t3() { } } --------------------- -1 : * NEW() -{ () -> if (2 > 3) { return@l } } : * NEW() -@l{ () -> if (2 > 3) { return@l } } : * COPY -{ 1 @l{ () -> if (2 > 3) { return@l } } } : * COPY -2 : * NEW() -{ 2 } : * COPY -try { 1 @l{ () -> if (2 > 3) { return@l } } } finally { 2 } : * COPY -{ try { 1 @l{ () -> if (2 > 3) { return@l } } } finally { 2 } } : * COPY +1 : * NEW: r(1) -> +{ () -> if (2 > 3) { return@l } } : * NEW: r({ () -> if (2 > 3) { return@l } }) -> +@l{ () -> if (2 > 3) { return@l } } : * COPY +{ 1 @l{ () -> if (2 > 3) { return@l } } } : * COPY +2 : * NEW: r(2) -> +{ 2 } : * COPY +try { 1 @l{ () -> if (2 > 3) { return@l } } } finally { 2 } : * COPY +{ try { 1 @l{ () -> if (2 > 3) { return@l } } } finally { 2 } } : * COPY ===================== == anonymous_0 == { () -> @@ -63,9 +63,9 @@ try { 1 @l{ () -> if (2 > 3) { return@l } } } finally { 2 } : * COPY } } --------------------- -2 : {<: Comparable} NEW() -3 : Int NEW() -2 > 3 : Boolean NEW(, ) +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(>, compareTo|, ) -> ===================== == t4 == fun t4() { @@ -81,9 +81,9 @@ fun t4() { } } --------------------- -{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } : * NEW() -@l{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } : * COPY -{ @l{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } } : * COPY +{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } : * NEW: r({ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } }) -> +@l{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } : * COPY +{ @l{ () -> try { 1 if (2 > 3) { return@l } } finally { 2 } } } : * COPY ===================== == anonymous_1 == { () -> @@ -97,12 +97,12 @@ fun t4() { } } --------------------- -1 : * NEW() -2 : {<: Comparable} NEW() -3 : Int NEW() -2 > 3 : Boolean NEW(, ) -2 : * NEW() -{ 2 } : * COPY +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(>, compareTo|, ) -> +2 : * NEW: r(2) -> +{ 2 } : * COPY ===================== == t5 == fun t5() { @@ -118,13 +118,13 @@ fun t5() { } } --------------------- -true : * NEW() -1 : * NEW() -2 : {<: Comparable} NEW() -3 : Int NEW() -2 > 3 : Boolean NEW(, ) -2 : * NEW() -{ 2 } : * COPY +true : * NEW: r(true) -> +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(>, compareTo|, ) -> +2 : * NEW: r(2) -> +{ 2 } : * COPY ===================== == t6 == fun t6() { @@ -141,17 +141,17 @@ fun t6() { } } --------------------- -true : * NEW() -1 : * NEW() -2 : {<: Comparable} NEW() -3 : Int NEW() -2 > 3 : Boolean NEW(, ) -5 : * NEW() -{ @l while(true) { 1 if (2 > 3) { break @l } } 5 } : * COPY -2 : * NEW() -{ 2 } : * COPY -try { @l while(true) { 1 if (2 > 3) { break @l } } 5 } finally { 2 } : * COPY -{ try { @l while(true) { 1 if (2 > 3) { break @l } } 5 } finally { 2 } } : * COPY +true : * NEW: r(true) -> +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(>, compareTo|, ) -> +5 : * NEW: r(5) -> +{ @l while(true) { 1 if (2 > 3) { break @l } } 5 } : * COPY +2 : * NEW: r(2) -> +{ 2 } : * COPY +try { @l while(true) { 1 if (2 > 3) { break @l } } 5 } finally { 2 } : * COPY +{ try { @l while(true) { 1 if (2 > 3) { break @l } } 5 } finally { 2 } } : * COPY ===================== == t7 == fun t7() { @@ -167,13 +167,13 @@ fun t7() { } } --------------------- -true : * NEW() -1 : * NEW() -2 : {<: Comparable} NEW() -3 : Int NEW() -2 > 3 : Boolean NEW(, ) -2 : * NEW() -{ 2 } : * COPY +true : * NEW: r(true) -> +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(>, compareTo|, ) -> +2 : * NEW: r(2) -> +{ 2 } : * COPY ===================== == t8 == fun t8(a : Int) { @@ -189,15 +189,17 @@ fun t8(a : Int) { } } --------------------- -1 : Int NEW() -a : Int NEW() -1..a : {<: Iterable} NEW(, ) -1 : * NEW() -2 : {<: Comparable} NEW() -3 : Int NEW() -2 > 3 : Boolean NEW(, ) -2 : * NEW() -{ 2 } : * COPY + : Int NEW: magic(a : Int) -> + : Int NEW: magic(1..a|) -> +1 : Int NEW: r(1) -> +a : Int NEW: r(a) -> +1..a : {<: Iterable} NEW: call(.., rangeTo|, ) -> +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(>, compareTo|, ) -> +2 : * NEW: r(2) -> +{ 2 } : * COPY ===================== == t9 == fun t9(a : Int) { @@ -214,19 +216,21 @@ fun t9(a : Int) { } } --------------------- -1 : Int NEW() -a : Int NEW() -1..a : {<: Iterable} NEW(, ) -1 : * NEW() -2 : {<: Comparable} NEW() -3 : Int NEW() -2 > 3 : Boolean NEW(, ) -5 : * NEW() -{ @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } : * COPY -2 : * NEW() -{ 2 } : * COPY -try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } finally { 2 } : * COPY -{ try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } finally { 2 } } : * COPY + : Int NEW: magic(a : Int) -> + : Int NEW: magic(1..a|) -> +1 : Int NEW: r(1) -> +a : Int NEW: r(a) -> +1..a : {<: Iterable} NEW: call(.., rangeTo|, ) -> +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(>, compareTo|, ) -> +5 : * NEW: r(5) -> +{ @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } : * COPY +2 : * NEW: r(2) -> +{ 2 } : * COPY +try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } finally { 2 } : * COPY +{ try { @l for (i in 1..a) { 1 if (2 > 3) { continue @l } } 5 } finally { 2 } } : * COPY ===================== == t10 == fun t10(a : Int) { @@ -242,15 +246,17 @@ fun t10(a : Int) { } } --------------------- -1 : Int NEW() -a : Int NEW() -1..a : {<: Iterable} NEW(, ) -1 : * NEW() -2 : {<: Comparable} NEW() -3 : Int NEW() -2 > 3 : Boolean NEW(, ) -2 : * NEW() -{ 2 } : * COPY + : Int NEW: magic(a : Int) -> + : Int NEW: magic(1..a|) -> +1 : Int NEW: r(1) -> +a : Int NEW: r(a) -> +1..a : {<: Iterable} NEW: call(.., rangeTo|, ) -> +1 : * NEW: r(1) -> +2 : {<: Comparable} NEW: r(2) -> +3 : Int NEW: r(3) -> +2 > 3 : Boolean NEW: call(>, compareTo|, ) -> +2 : * NEW: r(2) -> +{ 2 } : * COPY ===================== == t11 == fun t11() { @@ -262,8 +268,8 @@ fun t11() { } } --------------------- -1 : * NEW() -2 : Unit NEW() +1 : * NEW: r(1) -> +2 : Unit NEW: r(2) -> ===================== == t12 == fun t12() : Int { @@ -275,10 +281,10 @@ fun t12() : Int { } } --------------------- -1 : Int NEW() -3 : Int NEW() -doSmth(3) : * NEW() -{ doSmth(3) } : * COPY +1 : Int NEW: r(1) -> +3 : Int NEW: r(3) -> +doSmth(3) : * NEW: call(doSmth, doSmth|) -> +{ doSmth(3) } : * COPY ===================== == t13 == fun t13() : Int { @@ -293,15 +299,16 @@ fun t13() : Int { } } --------------------- -1 : Int NEW() -2 : Int NEW() -doSmth(2) : * NEW() -{ doSmth(2) } : * COPY -3 : Int NEW() -doSmth(3) : * NEW() -{ doSmth(3) } : * COPY -try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } finally { doSmth(3) } : * COPY -{ try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } finally { doSmth(3) } } : * COPY + : {<: UnsupportedOperationException} NEW: magic(e: UnsupportedOperationException) -> +1 : Int NEW: r(1) -> +2 : Int NEW: r(2) -> +doSmth(2) : * NEW: call(doSmth, doSmth|) -> +{ doSmth(2) } : * COPY +3 : Int NEW: r(3) -> +doSmth(3) : * NEW: call(doSmth, doSmth|) -> +{ doSmth(3) } : * COPY +try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } finally { doSmth(3) } : * COPY +{ try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } finally { doSmth(3) } } : * COPY ===================== == t14 == fun t14() : Int { @@ -313,12 +320,13 @@ fun t14() : Int { } } --------------------- -1 : Int NEW() -2 : Int NEW() -doSmth(2) : * NEW() -{ doSmth(2) } : * COPY -try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } : * COPY -{ try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } } : * COPY + : {<: UnsupportedOperationException} NEW: magic(e: UnsupportedOperationException) -> +1 : Int NEW: r(1) -> +2 : Int NEW: r(2) -> +doSmth(2) : * NEW: call(doSmth, doSmth|) -> +{ doSmth(2) } : * COPY +try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } : * COPY +{ try { return 1 } catch (e: UnsupportedOperationException) { doSmth(2) } } : * COPY ===================== == t15 == fun t15() : Int { @@ -333,11 +341,12 @@ fun t15() : Int { } } --------------------- -1 : Int NEW() -2 : Int NEW() -3 : Int NEW() -doSmth(3) : * NEW() -{ doSmth(3) } : * COPY + : {<: UnsupportedOperationException} NEW: magic(e: UnsupportedOperationException) -> +1 : Int NEW: r(1) -> +2 : Int NEW: r(2) -> +3 : Int NEW: r(3) -> +doSmth(3) : * NEW: call(doSmth, doSmth|) -> +{ doSmth(3) } : * COPY ===================== == t16 == fun t16() : Int { @@ -352,18 +361,20 @@ fun t16() : Int { } } --------------------- -1 : Int NEW() -doSmth(1) : * NEW() -{ doSmth(1) } : * COPY -2 : Int NEW() -3 : Int NEW() -doSmth(3) : * NEW() -{ doSmth(3) } : * COPY -try { doSmth(1) } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) } : * COPY -{ try { doSmth(1) } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) } } : * COPY + : {<: UnsupportedOperationException} NEW: magic(e: UnsupportedOperationException) -> +1 : Int NEW: r(1) -> +doSmth(1) : * NEW: call(doSmth, doSmth|) -> +{ doSmth(1) } : * COPY +2 : Int NEW: r(2) -> +3 : Int NEW: r(3) -> +doSmth(3) : * NEW: call(doSmth, doSmth|) -> +{ doSmth(3) } : * COPY +try { doSmth(1) } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) } : * COPY +{ try { doSmth(1) } catch (e: UnsupportedOperationException) { return 2 } finally { doSmth(3) } } : * COPY ===================== == doSmth == fun doSmth(i: Int) { } --------------------- + : Int NEW: magic(i: Int) -> ===================== diff --git a/compiler/testData/cfg/controlStructures/FinallyTestCopy.values b/compiler/testData/cfg/controlStructures/FinallyTestCopy.values index e49fa806b52..b8e799c364b 100644 --- a/compiler/testData/cfg/controlStructures/FinallyTestCopy.values +++ b/compiler/testData/cfg/controlStructures/FinallyTestCopy.values @@ -30,15 +30,17 @@ fun testCopy1() : Int { } } --------------------- -doSmth() : * NEW() -{ doSmth() } : * COPY -doSmth1() : * NEW() -{ doSmth1() } : * COPY -doSmth2() : * NEW() -{ doSmth2() } : * COPY -1 : Int NEW() -try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 } : * NEW(, , ) -{ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 } } : * COPY + : {<: NullPointerException} NEW: magic(e: NullPointerException) -> + : {<: Exception} NEW: magic(e: Exception) -> +doSmth() : * NEW: call(doSmth, doSmth) -> +{ doSmth() } : * COPY +doSmth1() : * NEW: call(doSmth1, doSmth1) -> +{ doSmth1() } : * COPY +doSmth2() : * NEW: call(doSmth2, doSmth2) -> +{ doSmth2() } : * COPY +1 : Int NEW: r(1) -> +try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 } : * NEW: merge(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 }|, , ) -> +{ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { return 1 } } : * COPY ===================== == testCopy2 == fun testCopy2() { @@ -59,16 +61,18 @@ fun testCopy2() { } } --------------------- -cond() : Boolean NEW() -doSmth() : * NEW() -{ doSmth() } : * COPY -doSmth1() : * NEW() -{ doSmth1() } : * COPY -doSmth2() : * NEW() -{ doSmth2() } : * COPY -cond() : Boolean NEW() -try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } : * NEW(, , ) -{ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } } : * COPY + : {<: NullPointerException} NEW: magic(e: NullPointerException) -> + : {<: Exception} NEW: magic(e: Exception) -> +cond() : Boolean NEW: call(cond, cond) -> +doSmth() : * NEW: call(doSmth, doSmth) -> +{ doSmth() } : * COPY +doSmth1() : * NEW: call(doSmth1, doSmth1) -> +{ doSmth1() } : * COPY +doSmth2() : * NEW: call(doSmth2, doSmth2) -> +{ doSmth2() } : * COPY +cond() : Boolean NEW: call(cond, cond) -> +try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } : * NEW: merge(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue }|, , ) -> +{ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { if (cond()) return else continue } } : * COPY ===================== == testCopy3 == fun testCopy3() { @@ -86,15 +90,17 @@ fun testCopy3() { } } --------------------- -doSmth() : * NEW() -{ doSmth() } : * COPY -doSmth1() : * NEW() -{ doSmth1() } : * COPY -doSmth2() : * NEW() -{ doSmth2() } : * COPY -cond() : Boolean NEW() -try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); } : * NEW(, , ) -{ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); } } : * COPY + : {<: NullPointerException} NEW: magic(e: NullPointerException) -> + : {<: Exception} NEW: magic(e: Exception) -> +doSmth() : * NEW: call(doSmth, doSmth) -> +{ doSmth() } : * COPY +doSmth1() : * NEW: call(doSmth1, doSmth1) -> +{ doSmth1() } : * COPY +doSmth2() : * NEW: call(doSmth2, doSmth2) -> +{ doSmth2() } : * COPY +cond() : Boolean NEW: call(cond, cond) -> +try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); } : * NEW: merge(try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); }|, , ) -> +{ try { doSmth() } catch (e: NullPointerException) { doSmth1() } catch (e: Exception) { doSmth2() } finally { while (cond()); } } : * COPY ===================== == doTestCopy4 == fun doTestCopy4(list: List?) : Int { @@ -107,11 +113,12 @@ fun doTestCopy4(list: List?) : Int { } } --------------------- -doSmth() : * NEW() -{ doSmth() } : * COPY -list : {<: Any?} NEW() -null : {<: Any?} NEW() -list != null : Boolean NEW(, ) -try { doSmth() } finally { if(list != null) { } } : * COPY -{ try { doSmth() } finally { if(list != null) { } } } : * COPY + : {<: List?} NEW: magic(list: List?) -> +doSmth() : * NEW: call(doSmth, doSmth) -> +{ doSmth() } : * COPY +list : {<: Any?} NEW: r(list) -> +null : {<: Any?} NEW: r(null) -> +list != null : Boolean NEW: call(!=, equals|, ) -> +try { doSmth() } finally { if(list != null) { } } : * COPY +{ try { doSmth() } finally { if(list != null) { } } } : * COPY ===================== diff --git a/compiler/testData/cfg/controlStructures/For.values b/compiler/testData/cfg/controlStructures/For.values index 027b5496c73..2d7fb08589b 100644 --- a/compiler/testData/cfg/controlStructures/For.values +++ b/compiler/testData/cfg/controlStructures/For.values @@ -5,14 +5,16 @@ fun t1() { } } --------------------- -1 : Int NEW() -2 : Int NEW() -1..2 : {<: Iterable} NEW(, ) -i : Int NEW() -doSmth(i) : * NEW() -{ doSmth(i) } : * COPY + : Int NEW: magic(1..2|) -> +1 : Int NEW: r(1) -> +2 : Int NEW: r(2) -> +1..2 : {<: Iterable} NEW: call(.., rangeTo|, ) -> +i : Int NEW: r(i) -> +doSmth(i) : * NEW: call(doSmth, doSmth|) -> +{ doSmth(i) } : * COPY ===================== == doSmth == fun doSmth(i: Int) {} --------------------- + : Int NEW: magic(i: Int) -> ===================== diff --git a/compiler/testData/cfg/controlStructures/If.values b/compiler/testData/cfg/controlStructures/If.values index e2c4f2cf276..726b9ced804 100644 --- a/compiler/testData/cfg/controlStructures/If.values +++ b/compiler/testData/cfg/controlStructures/If.values @@ -16,16 +16,17 @@ fun t1(b: Boolean) { doSmth(r) } --------------------- -b : Boolean NEW() -"s" : String NEW() -u : String NEW() -doSmth(u) : * NEW() -b : Boolean NEW() -"s" : String NEW() -"t" : String NEW() -r : String NEW() -doSmth(r) : * NEW() -{ var u: String if (b) { u = "s" } doSmth(u) var r: String if (b) { r = "s" } else { r = "t" } doSmth(r) } : * COPY + : Boolean NEW: magic(b: Boolean) -> +b : Boolean NEW: r(b) -> +"s" : String NEW: r("s") -> +u : String NEW: r(u) -> +doSmth(u) : * NEW: call(doSmth, doSmth|) -> +b : Boolean NEW: r(b) -> +"s" : String NEW: r("s") -> +"t" : String NEW: r("t") -> +r : String NEW: r(r) -> +doSmth(r) : * NEW: call(doSmth, doSmth|) -> +{ var u: String if (b) { u = "s" } doSmth(u) var r: String if (b) { r = "s" } else { r = "t" } doSmth(r) } : * COPY ===================== == t2 == fun t2(b: Boolean) { @@ -39,14 +40,16 @@ fun t2(b: Boolean) { } } --------------------- -3 : Int NEW() -b : Boolean NEW() -i : String NEW() -doSmth(i) : * NEW() -i : * NEW() -i is Int : Boolean NEW() + : Boolean NEW: magic(b: Boolean) -> +3 : Int NEW: r(3) -> +b : Boolean NEW: r(b) -> +i : String NEW: r(i) -> +doSmth(i) : * NEW: call(doSmth, doSmth|) -> +i : * NEW: r(i) -> +i is Int : Boolean NEW: magic(i is Int|) -> ===================== == doSmth == fun doSmth(s: String) {} --------------------- + : String NEW: magic(s: String) -> ===================== diff --git a/compiler/testData/cfg/controlStructures/OnlyWhileInFunctionBody.values b/compiler/testData/cfg/controlStructures/OnlyWhileInFunctionBody.values index b6eaafa0d7c..eeee63fd336 100644 --- a/compiler/testData/cfg/controlStructures/OnlyWhileInFunctionBody.values +++ b/compiler/testData/cfg/controlStructures/OnlyWhileInFunctionBody.values @@ -5,11 +5,11 @@ fun main() { } } --------------------- -0 : {<: Comparable} NEW() -1 : Int NEW() -0 > 1 : Boolean NEW(, ) -2 : * NEW() -{ 2 } : * COPY +0 : {<: Comparable} NEW: r(0) -> +1 : Int NEW: r(1) -> +0 > 1 : Boolean NEW: call(>, compareTo|, ) -> +2 : * NEW: r(2) -> +{ 2 } : * COPY ===================== == dowhile == fun dowhile() { @@ -17,7 +17,7 @@ fun dowhile() { while(0 > 1) } --------------------- -0 : * NEW() -1 : * NEW() -0 > 1 : * NEW(, ) +0 : * NEW: r(0) -> +1 : * NEW: r(1) -> +0 > 1 : * NEW: call(>, compareTo|, ) -> ===================== diff --git a/compiler/testData/cfg/controlStructures/returnsInWhen.values b/compiler/testData/cfg/controlStructures/returnsInWhen.values index f1835c8c05d..0bb026b5228 100644 --- a/compiler/testData/cfg/controlStructures/returnsInWhen.values +++ b/compiler/testData/cfg/controlStructures/returnsInWhen.values @@ -5,6 +5,8 @@ fun illegalWhenBlock(a: Any): Any { } } --------------------- -a : * NEW() -a : {<: Any} NEW() + : {<: Any} NEW: magic(a: Any) -> + : * NEW: magic(is Int|) -> +a : * NEW: r(a) -> +a : {<: Any} NEW: r(a) -> ===================== diff --git a/compiler/testData/cfg/conventions/bothReceivers.values b/compiler/testData/cfg/conventions/bothReceivers.values index 0e2db937727..eca297a429b 100644 --- a/compiler/testData/cfg/conventions/bothReceivers.values +++ b/compiler/testData/cfg/conventions/bothReceivers.values @@ -18,9 +18,10 @@ fun foobar(f: Foo) { Bar().f() } --------------------- -Bar() : Bar NEW() -f : Foo NEW() -f() : * NEW(, ) + : Foo NEW: magic(f: Foo) -> +Bar() : Bar NEW: call(Bar, ) -> +f : Foo NEW: r(f) -> +f() : * NEW: call(f, invoke|, ) -> Bar().f() : * COPY { Bar().f() } : * COPY -===================== \ No newline at end of file +===================== diff --git a/compiler/testData/cfg/conventions/equals.values b/compiler/testData/cfg/conventions/equals.values index 9d4a5bf3270..e59d786eaaf 100644 --- a/compiler/testData/cfg/conventions/equals.values +++ b/compiler/testData/cfg/conventions/equals.values @@ -4,7 +4,9 @@ fun foo(a: Int, b: Int) { } } --------------------- -a : OR{{<: Any}, {<: Any}} NEW() -b : {<: Any?} NEW() -a == b : Boolean NEW(, ) + : Int NEW: magic(a: Int) -> + : Int NEW: magic(b: Int) -> +a : OR{{<: Any}, {<: Any}} NEW: r(a) -> +b : {<: Any?} NEW: r(b) -> +a == b : Boolean NEW: call(==, equals|, ) -> ===================== diff --git a/compiler/testData/cfg/conventions/incrementAtTheEnd.values b/compiler/testData/cfg/conventions/incrementAtTheEnd.values index daed10577df..22098b2cb99 100644 --- a/compiler/testData/cfg/conventions/incrementAtTheEnd.values +++ b/compiler/testData/cfg/conventions/incrementAtTheEnd.values @@ -4,8 +4,8 @@ fun foo() { i++ } --------------------- -1 : Int NEW() -i : Int NEW() +1 : Int NEW: r(1) -> +i : Int NEW: r(i) -> i++ : Int COPY { var i = 1 i++ } : Int COPY ===================== diff --git a/compiler/testData/cfg/conventions/invoke.values b/compiler/testData/cfg/conventions/invoke.values index 02c3e5b3466..a4f83479e29 100644 --- a/compiler/testData/cfg/conventions/invoke.values +++ b/compiler/testData/cfg/conventions/invoke.values @@ -3,7 +3,8 @@ fun foo(f: () -> Unit) { f() } --------------------- -f : {<: () -> Unit} NEW() -f() : * NEW() + : {<: () -> Unit} NEW: magic(f: () -> Unit) -> +f : {<: () -> Unit} NEW: r(f) -> +f() : * NEW: call(f, invoke|) -> { f() } : * COPY ===================== diff --git a/compiler/testData/cfg/conventions/notEqual.values b/compiler/testData/cfg/conventions/notEqual.values index 5f758f0157a..07315fcaa79 100644 --- a/compiler/testData/cfg/conventions/notEqual.values +++ b/compiler/testData/cfg/conventions/notEqual.values @@ -3,7 +3,9 @@ fun neq(a: Int, b: Int) { if (a != b) {} } --------------------- -a : OR{{<: Any}, {<: Any}} NEW() -b : {<: Any?} NEW() -a != b : Boolean NEW(, ) + : Int NEW: magic(a: Int) -> + : Int NEW: magic(b: Int) -> +a : OR{{<: Any}, {<: Any}} NEW: r(a) -> +b : {<: Any?} NEW: r(b) -> +a != b : Boolean NEW: call(!=, equals|, ) -> ===================== diff --git a/compiler/testData/cfg/deadCode/DeadCode.values b/compiler/testData/cfg/deadCode/DeadCode.values index addf7ec3995..29bc8914e7e 100644 --- a/compiler/testData/cfg/deadCode/DeadCode.values +++ b/compiler/testData/cfg/deadCode/DeadCode.values @@ -4,7 +4,7 @@ fun test() { test() } --------------------- -Exception() : {<: Throwable} NEW() -test() : * NEW() -{ throw Exception() test() } : * COPY +Exception() : {<: Throwable} NEW: call(Exception, ) -> +test() : * NEW: call(test, test) -> +{ throw Exception() test() } : * COPY ===================== diff --git a/compiler/testData/cfg/deadCode/returnInElvis.values b/compiler/testData/cfg/deadCode/returnInElvis.values index 0a2dabc4721..e92efdc7e4c 100644 --- a/compiler/testData/cfg/deadCode/returnInElvis.values +++ b/compiler/testData/cfg/deadCode/returnInElvis.values @@ -3,7 +3,7 @@ fun foo() { return ?: null } --------------------- -null : * NEW() -return ?: null : * COPY -{ return ?: null } : * COPY +null : * NEW: r(null) -> +return ?: null : * COPY +{ return ?: null } : * COPY ===================== diff --git a/compiler/testData/cfg/deadCode/stringTemplate.values b/compiler/testData/cfg/deadCode/stringTemplate.values index 280634698cd..3c358f7060f 100644 --- a/compiler/testData/cfg/deadCode/stringTemplate.values +++ b/compiler/testData/cfg/deadCode/stringTemplate.values @@ -3,8 +3,8 @@ fun test() { "${throw Exception()} ${1}" } --------------------- -Exception() : {<: Throwable} NEW() -1 : * NEW() -"${throw Exception()} ${1}" : * NEW() +Exception() : {<: Throwable} NEW: call(Exception, ) -> +1 : * NEW: r(1) -> +"${throw Exception()} ${1}" : * NEW: magic("${throw Exception()} ${1}"|) -> { "${throw Exception()} ${1}" } : * COPY ===================== diff --git a/compiler/testData/cfg/declarations/classesAndObjects/AnonymousInitializers.values b/compiler/testData/cfg/declarations/classesAndObjects/AnonymousInitializers.values index 886da7ea362..9ece51d6f23 100644 --- a/compiler/testData/cfg/declarations/classesAndObjects/AnonymousInitializers.values +++ b/compiler/testData/cfg/declarations/classesAndObjects/AnonymousInitializers.values @@ -15,7 +15,9 @@ class AnonymousInitializers() { } } --------------------- -34 : Int NEW() -12 : Int NEW() -13 : Int NEW() + : AnonymousInitializers NEW: magic($i) -> + : AnonymousInitializers NEW: magic($i) -> +34 : Int NEW: r(34) -> +12 : Int NEW: r(12) -> +13 : Int NEW: r(13) -> ===================== diff --git a/compiler/testData/cfg/declarations/functionLiterals/unusedFunctionLiteral.values b/compiler/testData/cfg/declarations/functionLiterals/unusedFunctionLiteral.values index 5ac4b35aefe..1a6b4f8f683 100644 --- a/compiler/testData/cfg/declarations/functionLiterals/unusedFunctionLiteral.values +++ b/compiler/testData/cfg/declarations/functionLiterals/unusedFunctionLiteral.values @@ -3,7 +3,7 @@ fun foo() { {} } --------------------- -{} : * NEW() +{} : * NEW: r({}) -> { {} } : * COPY ===================== == anonymous_0 == diff --git a/compiler/testData/cfg/declarations/functions/FailFunction.values b/compiler/testData/cfg/declarations/functions/FailFunction.values index 7a6b3c52016..7c185a25542 100644 --- a/compiler/testData/cfg/declarations/functions/FailFunction.values +++ b/compiler/testData/cfg/declarations/functions/FailFunction.values @@ -3,6 +3,6 @@ fun fail() : Nothing { throw java.lang.RuntimeException() } --------------------- -RuntimeException() : {<: Throwable} NEW() +RuntimeException() : {<: Throwable} NEW: call(RuntimeException, ) -> java.lang.RuntimeException() : {<: Throwable} COPY ===================== diff --git a/compiler/testData/cfg/declarations/functions/typeParameter.values b/compiler/testData/cfg/declarations/functions/typeParameter.values index ab80f5a4ee4..ddeb2059902 100644 --- a/compiler/testData/cfg/declarations/functions/typeParameter.values +++ b/compiler/testData/cfg/declarations/functions/typeParameter.values @@ -3,6 +3,6 @@ fun foo() { T } --------------------- -T : * NEW() +T : * NEW: magic(T) -> { T } : * COPY ===================== diff --git a/compiler/testData/cfg/declarations/local/LocalDeclarations.values b/compiler/testData/cfg/declarations/local/LocalDeclarations.values index 9c4fe5cf211..597197f5a84 100644 --- a/compiler/testData/cfg/declarations/local/LocalDeclarations.values +++ b/compiler/testData/cfg/declarations/local/LocalDeclarations.values @@ -17,11 +17,12 @@ class C() { } } --------------------- -1 : Int NEW() +1 : Int NEW: r(1) -> ===================== == doSmth == fun doSmth(i: Int) {} --------------------- + : Int NEW: magic(i: Int) -> ===================== == test1 == fun test1() { @@ -33,8 +34,9 @@ fun test1() { } } --------------------- -1 : Int NEW() -object { val x : Int { $x = 1 } } : NEW() + : NEW: magic($x) -> +1 : Int NEW: r(1) -> +object { val x : Int { $x = 1 } } : NEW: r(object { val x : Int { $x = 1 } }) -> ===================== == O == object O { @@ -44,7 +46,8 @@ object O { } } --------------------- -1 : Int NEW() + : O NEW: magic($x) -> +1 : Int NEW: r(1) -> ===================== == test2 == fun test2() { @@ -54,9 +57,9 @@ fun test2() { } } --------------------- -1 : Int NEW() -b : Int NEW() -object { val x = b } : NEW() +1 : Int NEW: r(1) -> +b : Int NEW: r(b) -> +object { val x = b } : NEW: r(object { val x = b }) -> ===================== == test3 == fun test3() { @@ -68,14 +71,15 @@ fun test3() { } } --------------------- -object { val y : Int fun inner_bar() { y = 10 } } : NEW() +object { val y : Int fun inner_bar() { y = 10 } } : NEW: r(object { val y : Int fun inner_bar() { y = 10 } }) -> ===================== == inner_bar == fun inner_bar() { y = 10 } --------------------- -10 : Int NEW() + : NEW: magic(y) -> +10 : Int NEW: r(10) -> ===================== == test4 == fun test4() { @@ -91,15 +95,17 @@ fun test4() { } } --------------------- -1 : Int NEW() -object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } } : NEW() + : NEW: magic($x) -> +1 : Int NEW: r(1) -> +object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } } : NEW: r(object { val x : Int val y : Int { $x = 1 } fun ggg() { y = 10 } }) -> ===================== == ggg == fun ggg() { y = 10 } --------------------- -10 : Int NEW() + : NEW: magic(y) -> +10 : Int NEW: r(10) -> ===================== == test5 == fun test5() { @@ -117,21 +123,24 @@ fun test5() { } } --------------------- -1 : Int NEW() -2 : Int NEW() -object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } } : NEW() + : NEW: magic($x) -> +1 : Int NEW: r(1) -> +2 : Int NEW: r(2) -> +object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } } : NEW: r(object { var x = 1 { $x = 2 } fun foo() { x = 3 } fun bar() { x = 4 } }) -> ===================== == foo == fun foo() { x = 3 } --------------------- -3 : Int NEW() + : NEW: magic(x) -> +3 : Int NEW: r(3) -> ===================== == bar == fun bar() { x = 4 } --------------------- -4 : Int NEW() + : NEW: magic(x) -> +4 : Int NEW: r(4) -> ===================== diff --git a/compiler/testData/cfg/declarations/local/ObjectExpression.values b/compiler/testData/cfg/declarations/local/ObjectExpression.values index bf8c6041316..79ff8c63418 100644 --- a/compiler/testData/cfg/declarations/local/ObjectExpression.values +++ b/compiler/testData/cfg/declarations/local/ObjectExpression.values @@ -17,7 +17,7 @@ class B : A { == foo == override fun foo() = 10 --------------------- -10 : Int NEW() +10 : Int NEW: r(10) -> ===================== == foo == fun foo(b: B) : Int { @@ -25,9 +25,10 @@ fun foo(b: B) : Int { return o.foo() } --------------------- -b : * NEW() -object : A by b {} : NEW() -o : {<: A} NEW() -foo() : Int NEW() -o.foo() : Int COPY + : B NEW: magic(b: B) -> +b : * NEW: r(b) -> +object : A by b {} : NEW: r(object : A by b {}) -> +o : {<: A} NEW: r(o) -> +foo() : Int NEW: call(foo, foo|) -> +o.foo() : Int COPY ===================== diff --git a/compiler/testData/cfg/declarations/local/localClass.values b/compiler/testData/cfg/declarations/local/localClass.values index 4b9ec1b16cd..8d75950b182 100644 --- a/compiler/testData/cfg/declarations/local/localClass.values +++ b/compiler/testData/cfg/declarations/local/localClass.values @@ -21,12 +21,12 @@ fun f() { } } --------------------- -"" : String NEW() +"" : String NEW: r("") -> ===================== == loc == fun loc() { val x3 = "" } --------------------- -"" : String NEW() +"" : String NEW: r("") -> ===================== diff --git a/compiler/testData/cfg/declarations/local/localProperty.values b/compiler/testData/cfg/declarations/local/localProperty.values index bd5c69a29c0..096cc6d25a8 100644 --- a/compiler/testData/cfg/declarations/local/localProperty.values +++ b/compiler/testData/cfg/declarations/local/localProperty.values @@ -16,5 +16,5 @@ get() { return b } --------------------- -b : Int NEW() +b : Int NEW: r(b) -> ===================== diff --git a/compiler/testData/cfg/declarations/multiDeclaration/MultiDecl.values b/compiler/testData/cfg/declarations/multiDeclaration/MultiDecl.values index 99a44889fa0..a77d27d818a 100644 --- a/compiler/testData/cfg/declarations/multiDeclaration/MultiDecl.values +++ b/compiler/testData/cfg/declarations/multiDeclaration/MultiDecl.values @@ -8,12 +8,12 @@ class C { == component1 == fun component1() = 1 --------------------- -1 : Int NEW() +1 : Int NEW: r(1) -> ===================== == component2 == fun component2() = 2 --------------------- -2 : Int NEW() +2 : Int NEW: r(2) -> ===================== == test == fun test(c: C) { @@ -21,8 +21,9 @@ fun test(c: C) { val d = 1 } --------------------- -a : Int NEW() -b : Int NEW() -c : C NEW() -1 : Int NEW() + : C NEW: magic(c: C) -> +a : Int NEW: call(a, component1|) -> +b : Int NEW: call(b, component2|) -> +c : C NEW: r(c) -> +1 : Int NEW: r(1) -> ===================== diff --git a/compiler/testData/cfg/declarations/multiDeclaration/multiDeclarationWithError.values b/compiler/testData/cfg/declarations/multiDeclaration/multiDeclarationWithError.values index cad29edf6e3..b4899b7ce04 100644 --- a/compiler/testData/cfg/declarations/multiDeclaration/multiDeclarationWithError.values +++ b/compiler/testData/cfg/declarations/multiDeclaration/multiDeclarationWithError.values @@ -4,7 +4,10 @@ fun foo(x: Int) { a } --------------------- -x : * NEW() -a : * NEW() -{ val (a, b) = x a } : * COPY + : Int NEW: magic(x: Int) -> + : {<: [ERROR : component1() return type]} NEW: magic(a|) -> + : {<: [ERROR : component2() return type]} NEW: magic(b|) -> +x : * NEW: r(x) -> +a : * NEW: r(a) -> +{ val (a, b) = x a } : * COPY ===================== diff --git a/compiler/testData/cfg/declarations/properties/DelegatedProperty.values b/compiler/testData/cfg/declarations/properties/DelegatedProperty.values index 7197e993c66..832dbc60adc 100644 --- a/compiler/testData/cfg/declarations/properties/DelegatedProperty.values +++ b/compiler/testData/cfg/declarations/properties/DelegatedProperty.values @@ -7,15 +7,17 @@ class Delegate { == get == fun get(_this: Any, p: PropertyMetadata): Int = 0 --------------------- -0 : Int NEW() + : {<: Any} NEW: magic(_this: Any) -> + : {<: PropertyMetadata} NEW: magic(p: PropertyMetadata) -> +0 : Int NEW: r(0) -> ===================== == a == val a = Delegate() --------------------- -Delegate() : Delegate NEW() +Delegate() : Delegate NEW: call(Delegate, ) -> ===================== == b == val b by a --------------------- -a : * NEW() +a : * NEW: r(a) -> ===================== diff --git a/compiler/testData/cfg/declarations/properties/backingFieldAccess.values b/compiler/testData/cfg/declarations/properties/backingFieldAccess.values index 163de356aa2..111f192c242 100644 --- a/compiler/testData/cfg/declarations/properties/backingFieldAccess.values +++ b/compiler/testData/cfg/declarations/properties/backingFieldAccess.values @@ -8,6 +8,7 @@ class C { } } --------------------- -$a : * NEW() -{ $a } : * COPY + : C NEW: magic($a) -> +$a : * NEW: r($a|) -> +{ $a } : * COPY ===================== diff --git a/compiler/testData/cfg/declarations/properties/backingFieldQualifiedWithThis.values b/compiler/testData/cfg/declarations/properties/backingFieldQualifiedWithThis.values index 6c6f52e2a37..3cfdf3bbabc 100644 --- a/compiler/testData/cfg/declarations/properties/backingFieldQualifiedWithThis.values +++ b/compiler/testData/cfg/declarations/properties/backingFieldQualifiedWithThis.values @@ -8,10 +8,10 @@ abstract class Bar { == foo == fun foo() = "foo" + this.$bar --------------------- -"foo" : String NEW() -this : {<: Bar} COPY -this : {<: Bar} NEW() -$bar : {<: Any?} NEW() -this.$bar : {<: Any?} COPY -"foo" + this.$bar : String NEW(, ) +"foo" : String NEW: r("foo") -> +this : {<: Bar} COPY +this : {<: Bar} NEW: r(this) -> +$bar : {<: Any?} NEW: r($bar|) -> +this.$bar : {<: Any?} COPY +"foo" + this.$bar : String NEW: call(+, plus|, ) -> ===================== diff --git a/compiler/testData/cfg/expressions/Assignments.values b/compiler/testData/cfg/expressions/Assignments.values index f532d04aa5c..41621efe835 100644 --- a/compiler/testData/cfg/expressions/Assignments.values +++ b/compiler/testData/cfg/expressions/Assignments.values @@ -20,28 +20,28 @@ fun assignments() : Unit { t.x += 1 } --------------------- -1 : Int NEW() -2 : Int NEW() -x : Int NEW() -2 : Int NEW() -x += 2 : Int NEW(, ) -true : Boolean NEW() -1 : Int NEW() -2 : Int NEW() -if (true) 1 else 2 : Int NEW(, ) -true : Boolean NEW() -false : Boolean NEW() -true && false : Boolean NEW(, ) -false : Boolean NEW() -true : Boolean NEW() -false && true : Boolean NEW(, ) -Test() : Test NEW() -t : Test NEW() -1 : Int NEW() -t : Test NEW() -x : Int NEW() -t.x : Int COPY -1 : Int NEW() -t.x += 1 : Int NEW(, ) -{ var x = 1 x = 2 x += 2 x = if (true) 1 else 2 val y = true && false val z = false && true val t = Test(); t.x = 1 t.x += 1 } : Int COPY +1 : Int NEW: r(1) -> +2 : Int NEW: r(2) -> +x : Int NEW: r(x) -> +2 : Int NEW: r(2) -> +x += 2 : Int NEW: call(+=, plus|, ) -> +true : Boolean NEW: r(true) -> +1 : Int NEW: r(1) -> +2 : Int NEW: r(2) -> +if (true) 1 else 2 : Int NEW: merge(if (true) 1 else 2|, ) -> +true : Boolean NEW: r(true) -> +false : Boolean NEW: r(false) -> +true && false : Boolean NEW: magic(true && false|, ) -> +false : Boolean NEW: r(false) -> +true : Boolean NEW: r(true) -> +false && true : Boolean NEW: magic(false && true|, ) -> +Test() : Test NEW: call(Test, ) -> +t : Test NEW: r(t) -> +1 : Int NEW: r(1) -> +t : Test NEW: r(t) -> +x : Int NEW: r(x|) -> +t.x : Int COPY +1 : Int NEW: r(1) -> +t.x += 1 : Int NEW: call(+=, plus|, ) -> +{ var x = 1 x = 2 x += 2 x = if (true) 1 else 2 val y = true && false val z = false && true val t = Test(); t.x = 1 t.x += 1 } : Int COPY ===================== diff --git a/compiler/testData/cfg/expressions/LazyBooleans.values b/compiler/testData/cfg/expressions/LazyBooleans.values index b432c87df86..e3e4b0127e9 100644 --- a/compiler/testData/cfg/expressions/LazyBooleans.values +++ b/compiler/testData/cfg/expressions/LazyBooleans.values @@ -17,34 +17,36 @@ fun lazyBooleans(a : Boolean, b : Boolean) : Unit { 14 } --------------------- -a : Boolean NEW() -1 : * NEW() -{ 1 } : * COPY -2 : * NEW() -{ 2 } : * COPY -if (a) { 1 } else { 2 } : * NEW(, ) -3 : * NEW() -a : Boolean NEW() -b : Boolean NEW() -a && b : Boolean NEW(, ) -5 : * NEW() -6 : * NEW() -if (a && b) 5 else 6 : * NEW(, ) -7 : * NEW() -a : Boolean NEW() -b : Boolean NEW() -a || b : Boolean NEW(, ) -8 : * NEW() -9 : * NEW() -if (a || b) 8 else 9 : * NEW(, ) -10 : * NEW() -a : Boolean NEW() -11 : * NEW() -if (a) 11 : * COPY -12 : * NEW() -a : Boolean NEW() -13 : * NEW() -if (a) else 13 : * COPY -14 : * NEW() -{ if (a) { 1 } else { 2 } 3 if (a && b) 5 else 6 7 if (a || b) 8 else 9 10 if (a) 11 12 if (a) else 13 14 } : * COPY + : Boolean NEW: magic(a : Boolean) -> + : Boolean NEW: magic(b : Boolean) -> +a : Boolean NEW: r(a) -> +1 : * NEW: r(1) -> +{ 1 } : * COPY +2 : * NEW: r(2) -> +{ 2 } : * COPY +if (a) { 1 } else { 2 } : * NEW: merge(if (a) { 1 } else { 2 }|, ) -> +3 : * NEW: r(3) -> +a : Boolean NEW: r(a) -> +b : Boolean NEW: r(b) -> +a && b : Boolean NEW: magic(a && b|, ) -> +5 : * NEW: r(5) -> +6 : * NEW: r(6) -> +if (a && b) 5 else 6 : * NEW: merge(if (a && b) 5 else 6|, ) -> +7 : * NEW: r(7) -> +a : Boolean NEW: r(a) -> +b : Boolean NEW: r(b) -> +a || b : Boolean NEW: magic(a || b|, ) -> +8 : * NEW: r(8) -> +9 : * NEW: r(9) -> +if (a || b) 8 else 9 : * NEW: merge(if (a || b) 8 else 9|, ) -> +10 : * NEW: r(10) -> +a : Boolean NEW: r(a) -> +11 : * NEW: r(11) -> +if (a) 11 : * COPY +12 : * NEW: r(12) -> +a : Boolean NEW: r(a) -> +13 : * NEW: r(13) -> +if (a) else 13 : * COPY +14 : * NEW: r(14) -> +{ if (a) { 1 } else { 2 } 3 if (a && b) 5 else 6 7 if (a || b) 8 else 9 10 if (a) 11 12 if (a) else 13 14 } : * COPY ===================== diff --git a/compiler/testData/cfg/expressions/ReturnFromExpression.values b/compiler/testData/cfg/expressions/ReturnFromExpression.values index dc871c3aa57..abb245b93c1 100644 --- a/compiler/testData/cfg/expressions/ReturnFromExpression.values +++ b/compiler/testData/cfg/expressions/ReturnFromExpression.values @@ -3,8 +3,8 @@ fun blockAndAndMismatch() : Boolean { false || (return false) } --------------------- -false : Boolean NEW() -false : Boolean NEW() -false || (return false) : * NEW() -{ false || (return false) } : * COPY +false : Boolean NEW: r(false) -> +false : Boolean NEW: r(false) -> +false || (return false) : * NEW: magic(false || (return false)|) -> +{ false || (return false) } : * COPY ===================== diff --git a/compiler/testData/cfg/expressions/assignmentToThis.values b/compiler/testData/cfg/expressions/assignmentToThis.values index 2571d44967f..71164f37f9f 100644 --- a/compiler/testData/cfg/expressions/assignmentToThis.values +++ b/compiler/testData/cfg/expressions/assignmentToThis.values @@ -3,5 +3,6 @@ fun Int.bar(c: C) { this = c } --------------------- -c : * NEW() + : {<: [ERROR : C]} NEW: magic(c: C) -> +c : * NEW: r(c) -> ===================== diff --git a/compiler/testData/cfg/expressions/chainedQualifiedExpression.values b/compiler/testData/cfg/expressions/chainedQualifiedExpression.values index 03ec485f499..4ae30f206ef 100644 --- a/compiler/testData/cfg/expressions/chainedQualifiedExpression.values +++ b/compiler/testData/cfg/expressions/chainedQualifiedExpression.values @@ -50,141 +50,142 @@ public open class JetKeywordCompletionContributor() { } } --------------------- -1.0 : Double NEW() -BunchKeywordRegister() : JetKeywordCompletionContributor.BunchKeywordRegister NEW() -ABSTRACT_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -FINAL_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -OPEN_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -INTERNAL_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -PRIVATE_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -PROTECTED_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -PUBLIC_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -CLASS_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -ENUM_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -FUN_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -GET_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -SET_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -TRAIT_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -VAL_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -VAR_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -TYPE_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -IMPORT_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -add(IMPORT_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -PACKAGE_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -add(PACKAGE_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -OVERRIDE_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -add(OVERRIDE_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) .add(OVERRIDE_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -IN_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -inTopLevel : Double NEW() -add(IN_KEYWORD, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) .add(OVERRIDE_KEYWORD, inTopLevel) .add(IN_KEYWORD, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -OUT_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -inTopLevel : Double NEW() -add(OUT_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) .add(OVERRIDE_KEYWORD, inTopLevel) .add(IN_KEYWORD, inTopLevel, inTopLevel) .add(OUT_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -OBJECT_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW() -unresolvedCode : Double NEW() -add(OBJECT_KEYWORD, unresolvedCode) : JetKeywordCompletionContributor.BunchKeywordRegister NEW(, , ) -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) .add(OVERRIDE_KEYWORD, inTopLevel) .add(IN_KEYWORD, inTopLevel, inTopLevel) .add(OUT_KEYWORD, inTopLevel) .add(OBJECT_KEYWORD, unresolvedCode) : JetKeywordCompletionContributor.BunchKeywordRegister COPY -registerAll() : * NEW() -BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) .add(OVERRIDE_KEYWORD, inTopLevel) .add(IN_KEYWORD, inTopLevel, inTopLevel) .add(OUT_KEYWORD, inTopLevel) .add(OBJECT_KEYWORD, unresolvedCode) .registerAll() : * COPY -{ val inTopLevel = 1.0 BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) .add(OVERRIDE_KEYWORD, inTopLevel) .add(IN_KEYWORD, inTopLevel, inTopLevel) .add(OUT_KEYWORD, inTopLevel) .add(OBJECT_KEYWORD, unresolvedCode) .registerAll() } : * COPY + : {<: JetKeywordCompletionContributor} NEW: magic(BunchKeywordRegister()) -> +1.0 : Double NEW: r(1.0) -> +BunchKeywordRegister() : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(BunchKeywordRegister, |) -> +ABSTRACT_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(ABSTRACT_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +FINAL_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(FINAL_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +OPEN_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(OPEN_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +INTERNAL_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(INTERNAL_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +PRIVATE_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(PRIVATE_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +PROTECTED_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(PROTECTED_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +PUBLIC_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(PUBLIC_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +CLASS_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(CLASS_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +ENUM_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(ENUM_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +FUN_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(FUN_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +GET_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(GET_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +SET_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(SET_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +TRAIT_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(TRAIT_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +VAL_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(VAL_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +VAR_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(VAR_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +TYPE_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(TYPE_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +IMPORT_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(IMPORT_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(IMPORT_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +PACKAGE_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(PACKAGE_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(PACKAGE_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +OVERRIDE_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(OVERRIDE_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(OVERRIDE_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) .add(OVERRIDE_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +IN_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(IN_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(IN_KEYWORD, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) .add(OVERRIDE_KEYWORD, inTopLevel) .add(IN_KEYWORD, inTopLevel, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +OUT_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(OUT_KEYWORD) -> +inTopLevel : Double NEW: r(inTopLevel) -> +add(OUT_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) .add(OVERRIDE_KEYWORD, inTopLevel) .add(IN_KEYWORD, inTopLevel, inTopLevel) .add(OUT_KEYWORD, inTopLevel) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +OBJECT_KEYWORD : {<: [ERROR : Type annotation was missing]} NEW: r(OBJECT_KEYWORD) -> +unresolvedCode : Double NEW: magic(unresolvedCode) -> +add(OBJECT_KEYWORD, unresolvedCode) : JetKeywordCompletionContributor.BunchKeywordRegister NEW: call(add, add|, , ) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) .add(OVERRIDE_KEYWORD, inTopLevel) .add(IN_KEYWORD, inTopLevel, inTopLevel) .add(OUT_KEYWORD, inTopLevel) .add(OBJECT_KEYWORD, unresolvedCode) : JetKeywordCompletionContributor.BunchKeywordRegister COPY +registerAll() : * NEW: call(registerAll, registerAll|) -> +BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) .add(OVERRIDE_KEYWORD, inTopLevel) .add(IN_KEYWORD, inTopLevel, inTopLevel) .add(OUT_KEYWORD, inTopLevel) .add(OBJECT_KEYWORD, unresolvedCode) .registerAll() : * COPY +{ val inTopLevel = 1.0 BunchKeywordRegister() .add(ABSTRACT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FINAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(OPEN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(INTERNAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PRIVATE_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PROTECTED_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(PUBLIC_KEYWORD, inTopLevel, inTopLevel, inTopLevel, inTopLevel) .add(CLASS_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(ENUM_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(FUN_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(GET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(SET_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TRAIT_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAL_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(VAR_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(TYPE_KEYWORD, inTopLevel, inTopLevel, inTopLevel) .add(IMPORT_KEYWORD, inTopLevel) .add(PACKAGE_KEYWORD, inTopLevel) .add(OVERRIDE_KEYWORD, inTopLevel) .add(IN_KEYWORD, inTopLevel, inTopLevel) .add(OUT_KEYWORD, inTopLevel) .add(OBJECT_KEYWORD, unresolvedCode) .registerAll() } : * COPY ===================== == ABSTRACT_KEYWORD == val ABSTRACT_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == FINAL_KEYWORD == val FINAL_KEYWORD OPEN_KEYWORD = JetToken() @@ -193,100 +194,100 @@ val FINAL_KEYWORD OPEN_KEYWORD = JetToken() == OPEN_KEYWORD == val OPEN_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == INTERNAL_KEYWORD == val INTERNAL_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == PRIVATE_KEYWORD == val PRIVATE_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == PROTECTED_KEYWORD == val PROTECTED_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == PUBLIC_KEYWORD == val PUBLIC_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == CLASS_KEYWORD == val CLASS_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == ENUM_KEYWORD == val ENUM_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == FUN_KEYWORD == val FUN_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == GET_KEYWORD == val GET_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == SET_KEYWORD == val SET_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == TRAIT_KEYWORD == val TRAIT_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == VAL_KEYWORD == val VAL_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == VAR_KEYWORD == val VAR_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == TYPE_KEYWORD == val TYPE_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == IMPORT_KEYWORD == val IMPORT_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == PACKAGE_KEYWORD == val PACKAGE_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == OVERRIDE_KEYWORD == val OVERRIDE_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == IN_KEYWORD == val IN_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == OUT_KEYWORD == val OUT_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== == OBJECT_KEYWORD == val OBJECT_KEYWORD = JetToken() --------------------- -JetToken() : JetToken NEW() +JetToken() : JetToken NEW: call(JetToken, ) -> ===================== diff --git a/compiler/testData/cfg/expressions/expressionAsFunction.values b/compiler/testData/cfg/expressions/expressionAsFunction.values index 52a6534275b..db16ba62e4f 100644 --- a/compiler/testData/cfg/expressions/expressionAsFunction.values +++ b/compiler/testData/cfg/expressions/expressionAsFunction.values @@ -3,8 +3,9 @@ fun invoke(f: () -> Unit) { (f)() } --------------------- -f : {<: () -> Unit} NEW() -(f) : {<: () -> Unit} COPY -(f)() : * NEW() -{ (f)() } : * COPY + : {<: () -> Unit} NEW: magic(f: () -> Unit) -> +f : {<: () -> Unit} NEW: r(f) -> +(f) : {<: () -> Unit} COPY +(f)() : * NEW: call((f), invoke|) -> +{ (f)() } : * COPY ===================== diff --git a/compiler/testData/cfg/expressions/incdec.values b/compiler/testData/cfg/expressions/incdec.values index 060a72f960d..c90940b7858 100644 --- a/compiler/testData/cfg/expressions/incdec.values +++ b/compiler/testData/cfg/expressions/incdec.values @@ -3,6 +3,7 @@ fun bar(n: Int) { } --------------------- + : Int NEW: magic(n: Int) -> ===================== == foo == fun foo() { @@ -13,18 +14,18 @@ fun foo() { bar(--a) } --------------------- -1 : Int NEW() -a : Int NEW() -a++ : Int COPY -bar(a++) : * NEW() -a : Int NEW() -a-- : Int COPY -bar(a--) : * NEW() -a : Int NEW() -++a : Int NEW() -bar(++a) : * NEW() -a : Int NEW() ---a : Int NEW() -bar(--a) : * NEW() -{ var a = 1 bar(a++) bar(a--) bar(++a) bar(--a) } : * COPY +1 : Int NEW: r(1) -> +a : Int NEW: r(a) -> +a++ : Int COPY +bar(a++) : * NEW: call(bar, bar|) -> +a : Int NEW: r(a) -> +a-- : Int COPY +bar(a--) : * NEW: call(bar, bar|) -> +a : Int NEW: r(a) -> +++a : Int NEW: call(++, inc|) -> +bar(++a) : * NEW: call(bar, bar|) -> +a : Int NEW: r(a) -> +--a : Int NEW: call(--, dec|) -> +bar(--a) : * NEW: call(bar, bar|) -> +{ var a = 1 bar(a++) bar(a--) bar(++a) bar(--a) } : * COPY ===================== diff --git a/compiler/testData/cfg/expressions/nothingExpr.values b/compiler/testData/cfg/expressions/nothingExpr.values index 4cd3916aecd..a226abc4840 100644 --- a/compiler/testData/cfg/expressions/nothingExpr.values +++ b/compiler/testData/cfg/expressions/nothingExpr.values @@ -5,7 +5,7 @@ fun Any?.doSomething() {} == bar == fun bar(): Nothing = throw Exception() --------------------- -Exception() : {<: Throwable} NEW() +Exception() : {<: Throwable} NEW: call(Exception, ) -> ===================== == foo == fun foo() { @@ -13,11 +13,11 @@ fun foo() { bar().doSomething } --------------------- -null : * NEW() -null!! : * NEW() -doSomething() : * NEW() -null!!.doSomething() : * COPY -doSomething : * NEW() -bar().doSomething : * COPY -{ null!!.doSomething() bar().doSomething } : * COPY +null : * NEW: r(null) -> +null!! : * NEW: magic(null!!|) -> +doSomething() : * NEW: call(doSomething, doSomething|) -> +null!!.doSomething() : * COPY +doSomething : * NEW: call(doSomething, doSomething) -> +bar().doSomething : * COPY +{ null!!.doSomething() bar().doSomething } : * COPY ===================== diff --git a/compiler/testData/cfg/expressions/propertySafeCall.values b/compiler/testData/cfg/expressions/propertySafeCall.values index a288285f8f4..67972a084ca 100644 --- a/compiler/testData/cfg/expressions/propertySafeCall.values +++ b/compiler/testData/cfg/expressions/propertySafeCall.values @@ -3,8 +3,9 @@ fun test(s: String?) { s?.length } --------------------- -s : {<: CharSequence?} NEW() -length : * NEW() -s?.length : * COPY -{ s?.length } : * COPY + : {<: String?} NEW: magic(s: String?) -> +s : {<: CharSequence?} NEW: r(s) -> +length : * NEW: r(length|) -> +s?.length : * COPY +{ s?.length } : * COPY ===================== diff --git a/compiler/testData/cfg/expressions/qualifiedExpressionWithoutSelector.values b/compiler/testData/cfg/expressions/qualifiedExpressionWithoutSelector.values index 71888c1db6a..bb53a1e0aeb 100644 --- a/compiler/testData/cfg/expressions/qualifiedExpressionWithoutSelector.values +++ b/compiler/testData/cfg/expressions/qualifiedExpressionWithoutSelector.values @@ -3,7 +3,8 @@ fun foo(s: String) { s. } --------------------- -s : * NEW() -s. : * NEW() -{ s. } : * COPY + : String NEW: magic(s: String) -> +s : * NEW: r(s) -> +s. : * NEW: magic(s.|) -> +{ s. } : * COPY ===================== diff --git a/compiler/testData/cfg/expressions/thisExpression.values b/compiler/testData/cfg/expressions/thisExpression.values index a1db0a07d38..df9ca0222e3 100644 --- a/compiler/testData/cfg/expressions/thisExpression.values +++ b/compiler/testData/cfg/expressions/thisExpression.values @@ -3,6 +3,6 @@ fun Function0.foo() { this() } --------------------- -this() : * NEW() +this() : * NEW: call(this, invoke) -> { this() } : * COPY ===================== diff --git a/compiler/testData/cfg/expressions/unresolvedCall.values b/compiler/testData/cfg/expressions/unresolvedCall.values index e7c190cc644..12b3fa41a60 100644 --- a/compiler/testData/cfg/expressions/unresolvedCall.values +++ b/compiler/testData/cfg/expressions/unresolvedCall.values @@ -3,8 +3,9 @@ fun test(a: Any) { a.foo() } --------------------- -a : * NEW() -foo() : * NEW() -a.foo() : * COPY -{ a.foo() } : * COPY + : {<: Any} NEW: magic(a: Any) -> +a : * NEW: r(a) -> +foo() : * NEW: magic(foo()|) -> +a.foo() : * COPY +{ a.foo() } : * COPY ===================== diff --git a/compiler/testData/cfg/expressions/unresolvedProperty.values b/compiler/testData/cfg/expressions/unresolvedProperty.values index a9903e08e05..d6e1b81d1bb 100644 --- a/compiler/testData/cfg/expressions/unresolvedProperty.values +++ b/compiler/testData/cfg/expressions/unresolvedProperty.values @@ -3,8 +3,9 @@ fun test(a: Any) { a.foo } --------------------- -a : * NEW() -foo : * NEW() -a.foo : * COPY -{ a.foo } : * COPY + : {<: Any} NEW: magic(a: Any) -> +a : * NEW: r(a) -> +foo : * NEW: magic(foo|) -> +a.foo : * COPY +{ a.foo } : * COPY ===================== diff --git a/compiler/testData/cfg/expressions/unusedExpressionSimpleName.values b/compiler/testData/cfg/expressions/unusedExpressionSimpleName.values index 6e60c264f8f..70b9d6e3f52 100644 --- a/compiler/testData/cfg/expressions/unusedExpressionSimpleName.values +++ b/compiler/testData/cfg/expressions/unusedExpressionSimpleName.values @@ -3,6 +3,7 @@ fun main(arg : Array) { a } --------------------- -a : * NEW() -{ a } : * COPY + : {<: Array} NEW: magic(arg : Array) -> +a : * NEW: magic(a) -> +{ a } : * COPY ===================== diff --git a/compiler/testData/cfg/functions/DefaultValuesForArguments.values b/compiler/testData/cfg/functions/DefaultValuesForArguments.values index 1f17659350c..cab5857d9b2 100644 --- a/compiler/testData/cfg/functions/DefaultValuesForArguments.values +++ b/compiler/testData/cfg/functions/DefaultValuesForArguments.values @@ -1,9 +1,11 @@ == foo == fun foo(i: Int = 1, j: Int) = i + j --------------------- -1 : Int NEW() -i: Int = 1 : Int NEW(, ) -i : Int NEW() -j : Int NEW() -i + j : Int NEW(, ) + : Int NEW: magic(i: Int = 1) -> + : Int NEW: magic(j: Int) -> +1 : Int NEW: r(1) -> +i: Int = 1 : Int NEW: merge(i: Int = 1|, ) -> +i : Int NEW: r(i) -> +j : Int NEW: r(j) -> +i + j : Int NEW: call(+, plus|, ) -> ===================== diff --git a/compiler/testData/cfg/tailCalls/finally.values b/compiler/testData/cfg/tailCalls/finally.values index 164bdd47631..91e330a9346 100644 --- a/compiler/testData/cfg/tailCalls/finally.values +++ b/compiler/testData/cfg/tailCalls/finally.values @@ -7,6 +7,6 @@ tailRecursive fun test() : Int { } } --------------------- -test() : * NEW() +test() : * NEW: call(test, test) -> { test() } : * COPY ===================== diff --git a/compiler/testData/cfg/tailCalls/finallyWithReturn.values b/compiler/testData/cfg/tailCalls/finallyWithReturn.values index 11c80464648..faf82f7f340 100644 --- a/compiler/testData/cfg/tailCalls/finallyWithReturn.values +++ b/compiler/testData/cfg/tailCalls/finallyWithReturn.values @@ -7,5 +7,5 @@ tailRecursive fun test() : Int { } } --------------------- -test() : Int NEW() +test() : Int NEW: call(test, test) -> ===================== diff --git a/compiler/testData/cfg/tailCalls/sum.values b/compiler/testData/cfg/tailCalls/sum.values index 7df26749973..3fd87f430aa 100644 --- a/compiler/testData/cfg/tailCalls/sum.values +++ b/compiler/testData/cfg/tailCalls/sum.values @@ -4,17 +4,19 @@ tailRecursive fun sum(x: Long, sum: Long): Long { return sum(x - 1, sum + x) } --------------------- -x : OR{{<: Any}, {<: Any}} NEW() -0 : {<: Number} NEW() -toLong() : {<: Any?} NEW() -0.toLong() : {<: Any?} COPY -x == 0.toLong() : Boolean NEW(, ) -sum : Long NEW() -x : Long NEW() -1 : Int NEW() -x - 1 : Long NEW(, ) -sum : Long NEW() -x : Long NEW() -sum + x : Long NEW(, ) -sum(x - 1, sum + x) : Long NEW(, ) + : Long NEW: magic(x: Long) -> + : Long NEW: magic(sum: Long) -> +x : OR{{<: Any}, {<: Any}} NEW: r(x) -> +0 : {<: Number} NEW: r(0) -> +toLong() : {<: Any?} NEW: call(toLong, toLong|) -> +0.toLong() : {<: Any?} COPY +x == 0.toLong() : Boolean NEW: call(==, equals|, ) -> +sum : Long NEW: r(sum) -> +x : Long NEW: r(x) -> +1 : Int NEW: r(1) -> +x - 1 : Long NEW: call(-, minus|, ) -> +sum : Long NEW: r(sum) -> +x : Long NEW: r(x) -> +sum + x : Long NEW: call(+, plus|, ) -> +sum(x - 1, sum + x) : Long NEW: call(sum, sum|, ) -> ===================== diff --git a/compiler/testData/cfg/tailCalls/try.values b/compiler/testData/cfg/tailCalls/try.values index 269ddaa7c86..0de53c91e89 100644 --- a/compiler/testData/cfg/tailCalls/try.values +++ b/compiler/testData/cfg/tailCalls/try.values @@ -7,5 +7,6 @@ tailRecursive fun foo() { } } --------------------- -foo() : Unit NEW() + : {<: Throwable} NEW: magic(e: Throwable) -> +foo() : Unit NEW: call(foo, foo) -> ===================== diff --git a/compiler/testData/cfg/tailCalls/tryCatchFinally.values b/compiler/testData/cfg/tailCalls/tryCatchFinally.values index 08302009127..f33891190bd 100644 --- a/compiler/testData/cfg/tailCalls/tryCatchFinally.values +++ b/compiler/testData/cfg/tailCalls/tryCatchFinally.values @@ -9,12 +9,13 @@ fun test() : Unit { } } --------------------- -test() : * NEW() -{ test() } : * COPY -test() : * NEW() -{ test() } : * COPY -test() : * NEW() -{ test() } : * COPY -try { test() } catch (any : Exception) { test() } finally { test() } : * NEW(, ) -{ try { test() } catch (any : Exception) { test() } finally { test() } } : * COPY + : {<: Exception} NEW: magic(any : Exception) -> +test() : * NEW: call(test, test) -> +{ test() } : * COPY +test() : * NEW: call(test, test) -> +{ test() } : * COPY +test() : * NEW: call(test, test) -> +{ test() } : * COPY +try { test() } catch (any : Exception) { test() } finally { test() } : * NEW: merge(try { test() } catch (any : Exception) { test() } finally { test() }|, ) -> +{ try { test() } catch (any : Exception) { test() } finally { test() } } : * COPY ===================== diff --git a/compiler/tests/org/jetbrains/jet/cfg/AbstractPseudoValueTest.kt b/compiler/tests/org/jetbrains/jet/cfg/AbstractPseudoValueTest.kt index f980f195c5b..d3d20554597 100644 --- a/compiler/tests/org/jetbrains/jet/cfg/AbstractPseudoValueTest.kt +++ b/compiler/tests/org/jetbrains/jet/cfg/AbstractPseudoValueTest.kt @@ -25,6 +25,7 @@ import java.util.* import org.jetbrains.jet.lang.cfg.pseudocode.collectValueUsages import org.jetbrains.jet.lang.cfg.pseudocode.TypePredicate import org.jetbrains.jet.lang.cfg.pseudocode.getExpectedTypePredicate +import org.jetbrains.jet.lang.cfg.pseudocode.instructions.eval.InstructionWithValue public abstract class AbstractPseudoValueTest : AbstractPseudocodeTest() { override fun dumpInstructions(pseudocode: PseudocodeImpl, out: StringBuilder, bindingContext: BindingContext) { @@ -46,33 +47,47 @@ public abstract class AbstractPseudoValueTest : AbstractPseudocodeTest() { return elementToValues } - fun maxLength(strings: Iterable): Int = strings.map { it.length }.max() ?: 0 - - fun elementText(element: JetElement): String = element.getText()!!.replaceAll("\\s+", " ") + fun elementText(element: JetElement?): String = + element?.getText()?.replaceAll("\\s+", " ") ?: "" fun valueDecl(value: PseudoValue): String { val typePredicate = expectedTypePredicateMap.getOrPut(value) { getExpectedTypePredicate(value, valueUsageMap, bindingContext) } return "${value.debugName}: $typePredicate" } - fun valueDescription(element: JetElement, value: PseudoValue): String { - return if (value.element != element) "COPY" else "NEW${value.createdAt.inputValues.makeString(", ", "(", ")")}" + fun valueDescription(element: JetElement?, value: PseudoValue): String { + return if (value.element != element) "COPY" else "NEW: ${value.createdAt}" } val elementToValues = getElementToValueMap(pseudocode) - if (elementToValues.isEmpty()) return - - val elementColumnWidth = elementToValues.keySet().map { elementText(it).length() }.max()!! - val valueColumnWidth = elementToValues.values().map { valueDecl(it).length() }.max()!! - val valueDescColumnWidth = elementToValues.entrySet().map { valueDescription(it.key, it.value).length }.max()!! + val unboundValues = pseudocode.getInstructions() + .map { (it as? InstructionWithValue)?.outputValue } + .filterNotNull() + .filter { it.element == null } + .toSortedListBy { it.debugName } + val allValues = elementToValues.values() + unboundValues + if (allValues.isEmpty()) return + val valueDescriptions = LinkedHashMap, String>() + for (value in unboundValues) { + valueDescriptions[value to null] = valueDescription(null, value) + } for ((element, value) in elementToValues.entrySet()) { + valueDescriptions[value to element] = valueDescription(element, value) + } + + val elementColumnWidth = elementToValues.keySet().map { elementText(it).length() }.max() ?: 1 + val valueColumnWidth = allValues.map { valueDecl(it).length() }.max()!! + val valueDescColumnWidth = valueDescriptions.values().map { it.length }.max()!! + + for ((ve, description) in valueDescriptions.entrySet()) { + val (value, element) = ve out .append("%1$-${elementColumnWidth}s".format(elementText(element))) .append(" ") .append("%1$-${valueColumnWidth}s".format(valueDecl(value))) .append(" ") - .append("%1$-${valueDescColumnWidth}s".format(valueDescription(element, value))) + .append("%1$-${valueDescColumnWidth}s".format(description)) .append("\n") } } From fa73c5825ea20bb614e4f16f186273b7e92c1616 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Wed, 25 Jun 2014 19:35:04 +0400 Subject: [PATCH 19/20] Minor: Remove unused parameter --- .../jet/lang/cfg/JetControlFlowProcessor.java | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.java b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.java index 5abdb9058f1..bdc9a8ed052 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.java @@ -295,7 +295,7 @@ public class JetControlFlowProcessor { VariableAsFunctionResolvedCall variableAsFunctionResolvedCall = (VariableAsFunctionResolvedCall) resolvedCall; generateCall(expression, variableAsFunctionResolvedCall.getVariableCall()); } - else if (!generateCall(expression, true) && !(expression.getParent() instanceof JetCallExpression)) { + else if (!generateCall(expression) && !(expression.getParent() instanceof JetCallExpression)) { createNonSyntheticValue(expression, generateAndGetReceiverIfAny(expression)); } } @@ -353,7 +353,7 @@ public class JetControlFlowProcessor { mergeValues(Arrays.asList(left, right), expression); } else { - if (!generateCall(operationReference, true)) { + if (!generateCall(operationReference)) { generateBothArgumentsAndMark(expression); } } @@ -535,7 +535,7 @@ public class JetControlFlowProcessor { private void generateArrayAccess(JetArrayAccessExpression arrayAccessExpression, @Nullable ResolvedCall resolvedCall) { mark(arrayAccessExpression); - if (!checkAndGenerateCall(arrayAccessExpression, resolvedCall, true)) { + if (!checkAndGenerateCall(arrayAccessExpression, resolvedCall)) { generateArrayAccessWithoutCall(arrayAccessExpression); } } @@ -1070,7 +1070,7 @@ public class JetControlFlowProcessor { @Override public void visitCallExpression(@NotNull JetCallExpression expression) { JetExpression calleeExpression = expression.getCalleeExpression(); - if (!generateCall(calleeExpression, true)) { + if (!generateCall(calleeExpression)) { List inputExpressions = new ArrayList(); for (ValueArgument argument : expression.getValueArguments()) { JetExpression argumentExpression = argument.getArgumentExpression(); @@ -1197,7 +1197,7 @@ public class JetControlFlowProcessor { public void visitArrayAccessExpression(@NotNull JetArrayAccessExpression expression) { mark(expression); ResolvedCall getMethodResolvedCall = trace.get(BindingContext.INDEXED_LVALUE_GET, expression); - if (!checkAndGenerateCall(expression, getMethodResolvedCall, true)) { + if (!checkAndGenerateCall(expression, getMethodResolvedCall)) { generateArrayAccess(expression, getMethodResolvedCall); } } @@ -1378,12 +1378,15 @@ public class JetControlFlowProcessor { return trace.get(BindingContext.RESOLVED_CALL, expression); } - private boolean generateCall(@Nullable JetExpression calleeExpression, boolean bindResultValue) { + private boolean generateCall(@Nullable JetExpression calleeExpression) { if (calleeExpression == null) return false; - return checkAndGenerateCall(calleeExpression, getResolvedCall(calleeExpression), bindResultValue); + return checkAndGenerateCall(calleeExpression, getResolvedCall(calleeExpression)); } - private boolean checkAndGenerateCall(JetExpression calleeExpression, @Nullable ResolvedCall resolvedCall, boolean bindResultValue) { + private boolean checkAndGenerateCall( + JetExpression calleeExpression, + @Nullable ResolvedCall resolvedCall + ) { if (resolvedCall == null) { builder.compilationError(calleeExpression, "No resolved call"); return false; From e73ee4bbd67c6a96094f3e43f66afaedd36ba9d0 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Tue, 24 Jun 2014 19:46:48 +0400 Subject: [PATCH 20/20] Minor: Replace deprecated function call --- .../org/jetbrains/jet/lang/cfg/pseudocode/TypePredicate.kt | 4 ++-- .../cfg/pseudocode/instructions/eval/accessInstructions.kt | 4 ++-- .../cfg/pseudocode/instructions/eval/operationInstructions.kt | 2 +- .../instructions/jumps/NondeterministicJumpInstruction.kt | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/TypePredicate.kt b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/TypePredicate.kt index 04b8eb99a64..da985950d5e 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/TypePredicate.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/TypePredicate.kt @@ -41,13 +41,13 @@ public data class AllSubtypes(val upperBound: JetType): TypePredicate { public data class ForAllTypes(val typeSets: List): TypePredicate { override fun invoke(typeToCheck: JetType): Boolean = typeSets.all { it(typeToCheck) } - override fun toString(): String = "AND{${typeSets.makeString(", ")}}" + override fun toString(): String = "AND{${typeSets.joinToString(", ")}}" } public data class ForSomeType(val typeSets: List): TypePredicate { override fun invoke(typeToCheck: JetType): Boolean = typeSets.any { it(typeToCheck) } - override fun toString(): String = "OR{${typeSets.makeString(", ")}}" + override fun toString(): String = "OR{${typeSets.joinToString(", ")}}" } public object AllTypes : TypePredicate { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/accessInstructions.kt b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/accessInstructions.kt index c55a1a934dc..750faa6131d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/accessInstructions.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/accessInstructions.kt @@ -68,7 +68,7 @@ public class ReadValueInstruction private ( } override fun toString(): String { - val inVal = if (receiverValues.empty) "" else "|${receiverValues.keySet().makeString()}" + val inVal = if (receiverValues.empty) "" else "|${receiverValues.keySet().joinToString()}" return "r(${render(element)}$inVal) -> $outputValue" } @@ -113,7 +113,7 @@ public class WriteValueInstruction( override fun toString(): String { val lhs = (lValue as? JetNamedDeclaration)?.getName() ?: render(lValue) - return "w($lhs|${inputValues.makeString(", ")})" + return "w($lhs|${inputValues.joinToString(", ")})" } override fun createCopy(): InstructionImpl = diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/operationInstructions.kt b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/operationInstructions.kt index a53a8dad35b..b77374e9eb4 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/operationInstructions.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/eval/operationInstructions.kt @@ -40,7 +40,7 @@ public abstract class OperationInstruction protected( protected fun renderInstruction(name: String, desc: String): String = "$name($desc" + - (if (inputValues.notEmpty) "|${inputValues.makeString(", ")})" else ")") + + (if (inputValues.notEmpty) "|${inputValues.joinToString(", ")})" else ")") + (if (resultValue != null) " -> $resultValue" else "") protected fun setResult(value: PseudoValue?): OperationInstruction { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/jumps/NondeterministicJumpInstruction.kt b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/jumps/NondeterministicJumpInstruction.kt index 0166c5b463a..6d66d843bd7 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/jumps/NondeterministicJumpInstruction.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/pseudocode/instructions/jumps/NondeterministicJumpInstruction.kt @@ -72,7 +72,7 @@ public class NondeterministicJumpInstruction( override fun toString(): String { val inVal = if (inputValue != null) "|$inputValue" else "" - val labels = targetLabels.map { it.getName() }.makeString(", ") + val labels = targetLabels.map { it.getName() }.joinToString(", ") return "jmp?($labels$inVal)" }