diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrSourceRangesTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrSourceRangesTestGenerated.java new file mode 100644 index 00000000000..b4e890adb69 --- /dev/null +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrSourceRangesTestGenerated.java @@ -0,0 +1,139 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.runners.ir; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.test.generators.GenerateCompilerTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/ir/sourceRanges") +@TestDataPath("$PROJECT_ROOT") +public class FirLightTreeJvmIrSourceRangesTestGenerated extends AbstractFirLightTreeJvmIrSourceRangesTest { + @Test + public void testAllFilesPresentInSourceRanges() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/sourceRanges"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("annotations.kt") + public void testAnnotations() throws Exception { + runTest("compiler/testData/ir/sourceRanges/annotations.kt"); + } + + @Test + @TestMetadata("augmentedAssignmentWithExpression.kt") + public void testAugmentedAssignmentWithExpression() throws Exception { + runTest("compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.kt"); + } + + @Test + @TestMetadata("comments.kt") + public void testComments() throws Exception { + runTest("compiler/testData/ir/sourceRanges/comments.kt"); + } + + @Test + @TestMetadata("elvis.kt") + public void testElvis() throws Exception { + runTest("compiler/testData/ir/sourceRanges/elvis.kt"); + } + + @Test + @TestMetadata("kt17108.kt") + public void testKt17108() throws Exception { + runTest("compiler/testData/ir/sourceRanges/kt17108.kt"); + } + + @Test + @TestMetadata("kt24258.kt") + public void testKt24258() throws Exception { + runTest("compiler/testData/ir/sourceRanges/kt24258.kt"); + } + + @Test + @TestMetadata("postfixIncrementDecrement.kt") + public void testPostfixIncrementDecrement() throws Exception { + runTest("compiler/testData/ir/sourceRanges/postfixIncrementDecrement.kt"); + } + + @Nested + @TestMetadata("compiler/testData/ir/sourceRanges/declarations") + @TestDataPath("$PROJECT_ROOT") + public class Declarations { + @Test + public void testAllFilesPresentInDeclarations() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/sourceRanges/declarations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("classFuns.kt") + public void testClassFuns() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/classFuns.kt"); + } + + @Test + @TestMetadata("classProperties.kt") + public void testClassProperties() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/classProperties.kt"); + } + + @Test + @TestMetadata("classes.kt") + public void testClasses() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/classes.kt"); + } + + @Test + @TestMetadata("fakeOverrides.kt") + public void testFakeOverrides() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/fakeOverrides.kt"); + } + + @Test + @TestMetadata("kt29862.kt") + public void testKt29862() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/kt29862.kt"); + } + + @Test + @TestMetadata("primaryConstructors.kt") + public void testPrimaryConstructors() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/primaryConstructors.kt"); + } + + @Test + @TestMetadata("secondaryConstructors.kt") + public void testSecondaryConstructors() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/secondaryConstructors.kt"); + } + + @Test + @TestMetadata("synthesizedDataClassMembers.kt") + public void testSynthesizedDataClassMembers() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.kt"); + } + + @Test + @TestMetadata("topLevelFuns.kt") + public void testTopLevelFuns() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/topLevelFuns.kt"); + } + + @Test + @TestMetadata("topLevelProperties.kt") + public void testTopLevelProperties() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/topLevelProperties.kt"); + } + } +} diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrSourceRangesTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrSourceRangesTestGenerated.java new file mode 100644 index 00000000000..dc6885d17f2 --- /dev/null +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrSourceRangesTestGenerated.java @@ -0,0 +1,139 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.runners.ir; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.util.KtTestUtil; +import org.jetbrains.kotlin.test.TargetBackend; +import org.jetbrains.kotlin.test.TestMetadata; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import java.io.File; +import java.util.regex.Pattern; + +/** This class is generated by {@link org.jetbrains.kotlin.test.generators.GenerateCompilerTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("compiler/testData/ir/sourceRanges") +@TestDataPath("$PROJECT_ROOT") +public class FirPsiJvmIrSourceRangesTestGenerated extends AbstractFirPsiJvmIrSourceRangesTest { + @Test + public void testAllFilesPresentInSourceRanges() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/sourceRanges"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("annotations.kt") + public void testAnnotations() throws Exception { + runTest("compiler/testData/ir/sourceRanges/annotations.kt"); + } + + @Test + @TestMetadata("augmentedAssignmentWithExpression.kt") + public void testAugmentedAssignmentWithExpression() throws Exception { + runTest("compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.kt"); + } + + @Test + @TestMetadata("comments.kt") + public void testComments() throws Exception { + runTest("compiler/testData/ir/sourceRanges/comments.kt"); + } + + @Test + @TestMetadata("elvis.kt") + public void testElvis() throws Exception { + runTest("compiler/testData/ir/sourceRanges/elvis.kt"); + } + + @Test + @TestMetadata("kt17108.kt") + public void testKt17108() throws Exception { + runTest("compiler/testData/ir/sourceRanges/kt17108.kt"); + } + + @Test + @TestMetadata("kt24258.kt") + public void testKt24258() throws Exception { + runTest("compiler/testData/ir/sourceRanges/kt24258.kt"); + } + + @Test + @TestMetadata("postfixIncrementDecrement.kt") + public void testPostfixIncrementDecrement() throws Exception { + runTest("compiler/testData/ir/sourceRanges/postfixIncrementDecrement.kt"); + } + + @Nested + @TestMetadata("compiler/testData/ir/sourceRanges/declarations") + @TestDataPath("$PROJECT_ROOT") + public class Declarations { + @Test + public void testAllFilesPresentInDeclarations() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/ir/sourceRanges/declarations"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); + } + + @Test + @TestMetadata("classFuns.kt") + public void testClassFuns() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/classFuns.kt"); + } + + @Test + @TestMetadata("classProperties.kt") + public void testClassProperties() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/classProperties.kt"); + } + + @Test + @TestMetadata("classes.kt") + public void testClasses() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/classes.kt"); + } + + @Test + @TestMetadata("fakeOverrides.kt") + public void testFakeOverrides() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/fakeOverrides.kt"); + } + + @Test + @TestMetadata("kt29862.kt") + public void testKt29862() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/kt29862.kt"); + } + + @Test + @TestMetadata("primaryConstructors.kt") + public void testPrimaryConstructors() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/primaryConstructors.kt"); + } + + @Test + @TestMetadata("secondaryConstructors.kt") + public void testSecondaryConstructors() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/secondaryConstructors.kt"); + } + + @Test + @TestMetadata("synthesizedDataClassMembers.kt") + public void testSynthesizedDataClassMembers() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.kt"); + } + + @Test + @TestMetadata("topLevelFuns.kt") + public void testTopLevelFuns() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/topLevelFuns.kt"); + } + + @Test + @TestMetadata("topLevelProperties.kt") + public void testTopLevelProperties() throws Exception { + runTest("compiler/testData/ir/sourceRanges/declarations/topLevelProperties.kt"); + } + } +} diff --git a/compiler/testData/ir/sourceRanges/annotations.fir.txt b/compiler/testData/ir/sourceRanges/annotations.fir.txt new file mode 100644 index 00000000000..aefd894add2 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/annotations.fir.txt @@ -0,0 +1,36 @@ +@0:0..5:0 FILE fqName: fileName:/annotations.kt + @0:0..1:63 CLASS ANNOTATION_CLASS name:MyAnnotation modality:OPEN visibility:internal superTypes:[kotlin.Annotation] + annotations: + @0:0..102 CONSTRUCTOR_CALL 'public constructor (vararg allowedTargets: kotlin.annotation.AnnotationTarget) [primary] declared in kotlin.annotation.Target' type=kotlin.annotation.Target origin=null + @0:8..101 VARARG type=kotlin.Array varargElementType=kotlin.annotation.AnnotationTarget + @0:25..33 GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:FUNCTION' type=kotlin.annotation.AnnotationTarget + @0:52..67 GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY_GETTER' type=kotlin.annotation.AnnotationTarget + @0:86..101 GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:PROPERTY_SETTER' type=kotlin.annotation.AnnotationTarget + @1:38..63 CONSTRUCTOR visibility:public <> (description:kotlin.String) returnType:.MyAnnotation [primary] + @1:39..62 VALUE_PARAMETER name:description index:0 type:kotlin.String + @1:38..63 BLOCK_BODY + @0:0..1:63 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @1:38..63 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:MyAnnotation modality:OPEN visibility:internal superTypes:[kotlin.Annotation]' + @1:39..62 PROPERTY name:description visibility:public modality:FINAL [val] + @1:39..62 FIELD PROPERTY_BACKING_FIELD name:description type:kotlin.String visibility:private [final] + @1:39..62 EXPRESSION_BODY + @1:39..62 GET_VAR 'description: kotlin.String declared in .MyAnnotation.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + @1:39..62 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyAnnotation) returnType:kotlin.String + @1:39..62 VALUE_PARAMETER name: type:.MyAnnotation + @1:39..62 BLOCK_BODY + @1:39..62 RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .MyAnnotation' + @1:39..62 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:description type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + @1:39..62 GET_VAR ': .MyAnnotation declared in .MyAnnotation.' type=.MyAnnotation origin=null + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @0:0..1:63 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyAnnotation + @3:0..4:12 FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Unit + annotations: + @3:0..29 CONSTRUCTOR_CALL 'public constructor (description: kotlin.String) [primary] declared in .MyAnnotation' type=.MyAnnotation origin=null + @3:14..28 CONST String type=kotlin.String value="fooAnotation" + @4:10..12 BLOCK_BODY diff --git a/compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.fir.txt b/compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.fir.txt new file mode 100644 index 00000000000..f43ede49f19 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/augmentedAssignmentWithExpression.fir.txt @@ -0,0 +1,46 @@ +@0:0..23:0 FILE fqName:test fileName:/augmentedAssignmentWithExpression.kt + @2:0..8:1 CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] + @2:0..8:1 CONSTRUCTOR visibility:public <> () returnType:test.Host [primary] + @2:0..8:1 BLOCK_BODY + @2:0..8:1 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @2:0..8:1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' + @3:4..38 FUN name:plusAssign visibility:public modality:FINAL <> ($this:test.Host, x:kotlin.Int) returnType:kotlin.Unit [operator] + @3:4..38 VALUE_PARAMETER name: type:test.Host + @3:28..34 VALUE_PARAMETER name:x index:0 type:kotlin.Int + @3:36..38 BLOCK_BODY + @5:4..7:5 FUN name:test1 visibility:public modality:FINAL <> ($this:test.Host) returnType:kotlin.Unit + @5:4..7:5 VALUE_PARAMETER name: type:test.Host + @5:16..7:5 BLOCK_BODY + @6:8..17 CALL 'public final fun plusAssign (x: kotlin.Int): kotlin.Unit [operator] declared in test.Host' type=kotlin.Unit origin=null + @6:8..12 GET_VAR ': test.Host declared in test.Host.test1' type=test.Host origin=null + @6:16..17 CONST Int type=kotlin.Int value=1 + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @2:0..8:1 VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Host + @10:0..18 FUN name:foo visibility:public modality:FINAL <> () returnType:test.Host + @10:12..18 BLOCK_BODY + @10:18..18 RETURN type=kotlin.Nothing from='public final fun foo (): test.Host declared in test' + @10:12..18 CONSTRUCTOR_CALL 'public constructor () [primary] declared in test.Host' type=test.Host origin=null + @12:0..14:1 FUN name:test2 visibility:public modality:FINAL <> ($receiver:test.Host) returnType:kotlin.Unit + @12:4..8 VALUE_PARAMETER name: type:test.Host + @12:17..14:1 BLOCK_BODY + @13:4..13 CALL 'public final fun plusAssign (x: kotlin.Int): kotlin.Unit [operator] declared in test.Host' type=kotlin.Unit origin=null + @13:4..8 GET_VAR ': test.Host declared in test.test2' type=test.Host origin=null + @13:12..13 CONST Int type=kotlin.Int value=1 + @16:0..18:1 FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit + @16:12..18:1 BLOCK_BODY + @17:4..14 CALL 'public final fun plusAssign (x: kotlin.Int): kotlin.Unit [operator] declared in test.Host' type=kotlin.Unit origin=null + @17:4..9 CALL 'public final fun foo (): test.Host declared in test' type=test.Host origin=null + @17:13..14 CONST Int type=kotlin.Int value=1 + @20:0..22:1 FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit + @20:10..23 VALUE_PARAMETER name:a index:0 type:kotlin.Function0 + @20:25..22:1 BLOCK_BODY + @21:4..12 CALL 'public final fun plusAssign (x: kotlin.Int): kotlin.Unit [operator] declared in test.Host' type=kotlin.Unit origin=null + @21:4..7 CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=test.Host origin=INVOKE + @21:4..5 GET_VAR 'a: kotlin.Function0 declared in test.test4' type=kotlin.Function0 origin=VARIABLE_AS_FUNCTION + @21:11..12 CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/sourceRanges/comments.fir.txt b/compiler/testData/ir/sourceRanges/comments.fir.txt new file mode 100644 index 00000000000..74380586fbf --- /dev/null +++ b/compiler/testData/ir/sourceRanges/comments.fir.txt @@ -0,0 +1,51 @@ +@0:0..34:0 FILE fqName: fileName:/comments.kt + @1:0..33:1 CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any] + @1:0..33:1 CONSTRUCTOR visibility:public <> () returnType:.Foo [primary] + @1:0..33:1 BLOCK_BODY + @1:0..33:1 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @1:0..33:1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Foo modality:FINAL visibility:public superTypes:[kotlin.Any]' + @8:4..10:36 CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + @8:52..79 CONSTRUCTOR visibility:private <> ($this:.Foo, x:kotlin.Int) returnType:.Foo.Inner [primary] + @8:52..79 VALUE_PARAMETER name: type:.Foo + @8:72..78 VALUE_PARAMETER name:x index:0 type:kotlin.Int + @8:52..79 BLOCK_BODY + @8:4..10:36 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @8:52..79 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Inner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @8:4..10:36 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo.Inner + @18:4..20:39 FUN name:foo visibility:protected modality:OPEN <> ($this:.Foo, y:kotlin.Int) returnType:kotlin.Unit + @18:4..20:39 VALUE_PARAMETER name: type:.Foo + @18:27..33 VALUE_PARAMETER name:y index:0 type:kotlin.Int + @18:35..20:39 BLOCK_BODY + @25:4..27:25 PROPERTY name:x visibility:public modality:FINAL [val] + @25:4..27:25 FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + @25:17..19 EXPRESSION_BODY + @25:17..19 CONST Int type=kotlin.Int value=42 + @25:4..27:25 FUN name: visibility:public modality:FINAL <> ($this:.Foo) returnType:kotlin.Int + @25:4..27:25 VALUE_PARAMETER name: type:.Foo + @27:16..25 BLOCK_BODY + @27:25..25 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Foo' + @27:22..25 CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=PLUS + @27:16..21 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=GET_PROPERTY + @27:16..21 GET_VAR ': .Foo declared in .Foo.' type=.Foo origin=null + @27:24..25 CONST Int type=kotlin.Int value=1 + @30:4..32:5 FUN name:test visibility:public modality:FINAL <> ($this:.Foo) returnType:kotlin.Unit + @30:4..32:5 VALUE_PARAMETER name: type:.Foo + @30:15..32:5 BLOCK_BODY + @31:8..41 CALL 'protected open fun foo (y: kotlin.Int): kotlin.Unit declared in .Foo' type=kotlin.Unit origin=null + @31:8..41 GET_VAR ': .Foo declared in .Foo.test' type=.Foo origin=null + @31:38..40 CONST Int type=kotlin.Int value=42 + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @1:0..33:1 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Foo diff --git a/compiler/testData/ir/sourceRanges/declarations/classFuns.fir.txt b/compiler/testData/ir/sourceRanges/declarations/classFuns.fir.txt new file mode 100644 index 00000000000..4859095f860 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/declarations/classFuns.fir.txt @@ -0,0 +1,30 @@ +@0:0..24:0 FILE fqName:test fileName:/classFuns.kt + @3:0..23:1 CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] + @3:0..23:1 CONSTRUCTOR visibility:public <> () returnType:test.Test [primary] + @3:0..23:1 BLOCK_BODY + @3:0..23:1 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @3:0..23:1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' + @5:4..18 FUN name:test0 visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Unit + @5:4..18 VALUE_PARAMETER name: type:test.Test + @5:16..18 BLOCK_BODY + @11:4..18 FUN name:test1 visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Unit + @11:4..18 VALUE_PARAMETER name: type:test.Test + @11:16..18 BLOCK_BODY + @14:4..17:18 FUN name:test2 visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Unit + annotations: + @14:4..16:5 CONSTRUCTOR_CALL 'public constructor (vararg names: kotlin.String) [primary] declared in kotlin.Suppress' type=kotlin.Suppress origin=null + @15:8..25 VARARG type=kotlin.Array varargElementType=kotlin.String + @15:8..25 CONST String type=kotlin.String value="UNUSED_VARIABLE" + @14:4..17:18 VALUE_PARAMETER name: type:test.Test + @17:16..18 BLOCK_BODY + @20:4..21:18 FUN name:test3 visibility:private modality:FINAL <> ($this:test.Test) returnType:kotlin.Unit + @20:4..21:18 VALUE_PARAMETER name: type:test.Test + @21:16..18 BLOCK_BODY + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @3:0..23:1 VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Test diff --git a/compiler/testData/ir/sourceRanges/declarations/classProperties.fir.txt b/compiler/testData/ir/sourceRanges/declarations/classProperties.fir.txt new file mode 100644 index 00000000000..4a2dc6d8d68 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/declarations/classProperties.fir.txt @@ -0,0 +1,192 @@ +@0:0..78:0 FILE fqName:test fileName:/classProperties.kt + @2:0..77:1 CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] + @2:0..77:1 CONSTRUCTOR visibility:public <> () returnType:test.Test [primary] + @2:0..77:1 BLOCK_BODY + @2:0..77:1 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @2:0..77:1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' + @4:4..18 PROPERTY name:test0 visibility:public modality:FINAL [val] + @4:4..18 FIELD PROPERTY_BACKING_FIELD name:test0 type:kotlin.Int visibility:private [final] + @4:16..18 EXPRESSION_BODY + @4:16..18 CONST Int type=kotlin.Int value=42 + @4:4..18 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @4:4..18 VALUE_PARAMETER name: type:test.Test + @4:4..18 BLOCK_BODY + @4:4..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @4:4..18 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @4:4..18 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @10:4..18 PROPERTY name:test1 visibility:public modality:FINAL [val] + @10:4..18 FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final] + @10:16..18 EXPRESSION_BODY + @10:16..18 CONST Int type=kotlin.Int value=42 + @10:4..18 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @10:4..18 VALUE_PARAMETER name: type:test.Test + @10:4..18 BLOCK_BODY + @10:4..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @10:4..18 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @10:4..18 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @13:4..16:18 PROPERTY name:test2 visibility:public modality:FINAL [val] + annotations: + @13:4..15:5 CONSTRUCTOR_CALL 'public constructor (vararg names: kotlin.String) [primary] declared in kotlin.Suppress' type=kotlin.Suppress origin=null + @14:8..25 VARARG type=kotlin.Array varargElementType=kotlin.String + @14:8..25 CONST String type=kotlin.String value="UNUSED_VARIABLE" + @13:4..16:18 FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:private [final] + @16:16..18 EXPRESSION_BODY + @16:16..18 CONST Int type=kotlin.Int value=42 + @13:4..16:18 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @13:4..16:18 VALUE_PARAMETER name: type:test.Test + @13:4..16:18 BLOCK_BODY + @13:4..16:18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @13:4..16:18 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @13:4..16:18 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @19:4..20:18 PROPERTY name:test3 visibility:private modality:FINAL [val] + @19:4..20:18 FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private [final] + @20:16..18 EXPRESSION_BODY + @20:16..18 CONST Int type=kotlin.Int value=42 + @19:4..20:18 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @19:4..20:18 VALUE_PARAMETER name: type:test.Test + @19:4..20:18 BLOCK_BODY + @19:4..20:18 RETURN type=kotlin.Nothing from='private final fun (): kotlin.Int declared in test.Test' + @19:4..20:18 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @19:4..20:18 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @23:4..24 PROPERTY name:test4 visibility:public modality:FINAL [val] + @23:4..24 FUN name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @23:4..24 VALUE_PARAMETER name: type:test.Test + @23:22..24 BLOCK_BODY + @23:24..24 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @23:22..24 CONST Int type=kotlin.Int value=42 + @26:4..27:18 PROPERTY name:test5 visibility:public modality:FINAL [val] + @26:4..27:18 FUN name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @26:4..27:18 VALUE_PARAMETER name: type:test.Test + @27:16..18 BLOCK_BODY + @27:18..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @27:16..18 CONST Int type=kotlin.Int value=42 + @30:4..34:18 PROPERTY name:test6 visibility:public modality:FINAL [val] + @30:4..34:18 FUN name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @30:4..34:18 VALUE_PARAMETER name: type:test.Test + @34:16..18 BLOCK_BODY + @34:18..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @34:16..18 CONST Int type=kotlin.Int value=42 + @37:4..41:18 PROPERTY name:test7 visibility:public modality:FINAL [val] + @37:4..41:18 FUN name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + annotations: + @38:8..40:9 CONSTRUCTOR_CALL 'public constructor (vararg names: kotlin.String) [primary] declared in kotlin.Suppress' type=kotlin.Suppress origin=null + @39:12..29 VARARG type=kotlin.Array varargElementType=kotlin.String + @39:12..29 CONST String type=kotlin.String value="UNUSED_VARIABLE" + @37:4..41:18 VALUE_PARAMETER name: type:test.Test + @41:16..18 BLOCK_BODY + @41:18..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @41:16..18 CONST Int type=kotlin.Int value=42 + @44:4..18 PROPERTY name:test8 visibility:public modality:FINAL [var] + @44:4..18 FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Int visibility:private + @44:16..18 EXPRESSION_BODY + @44:16..18 CONST Int type=kotlin.Int value=42 + @44:4..18 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @44:4..18 VALUE_PARAMETER name: type:test.Test + @44:4..18 BLOCK_BODY + @44:4..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @44:4..18 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Int visibility:private' type=kotlin.Int origin=null + @44:4..18 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @44:4..18 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Test, :kotlin.Int) returnType:kotlin.Unit + @44:4..18 VALUE_PARAMETER name: type:test.Test + @44:4..18 VALUE_PARAMETER name: index:0 type:kotlin.Int + @44:4..18 BLOCK_BODY + @44:4..18 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + @44:4..18 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @44:4..18 GET_VAR ': kotlin.Int declared in test.Test.' type=kotlin.Int origin=null + @47:4..31 PROPERTY name:test9 visibility:public modality:FINAL [var] + @47:4..31 FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Int visibility:private + @47:16..18 EXPRESSION_BODY + @47:16..18 CONST Int type=kotlin.Int value=42 + @47:4..31 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @47:4..31 VALUE_PARAMETER name: type:test.Test + @47:4..31 BLOCK_BODY + @47:4..31 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @47:4..31 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Int visibility:private' type=kotlin.Int origin=null + @47:4..31 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @47:4..31 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:test.Test, :kotlin.Int) returnType:kotlin.Unit + @47:4..31 VALUE_PARAMETER name: type:test.Test + @47:4..31 VALUE_PARAMETER name: index:0 type:kotlin.Int + @47:4..31 BLOCK_BODY + @47:4..31 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + @47:4..31 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @47:4..31 GET_VAR ': kotlin.Int declared in test.Test.' type=kotlin.Int origin=null + @50:4..51:19 PROPERTY name:test10 visibility:public modality:FINAL [var] + @50:4..51:19 FIELD PROPERTY_BACKING_FIELD name:test10 type:kotlin.Int visibility:private + @50:17..19 EXPRESSION_BODY + @50:17..19 CONST Int type=kotlin.Int value=42 + @50:4..51:19 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @50:4..51:19 VALUE_PARAMETER name: type:test.Test + @50:4..51:19 BLOCK_BODY + @50:4..51:19 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @50:4..51:19 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test10 type:kotlin.Int visibility:private' type=kotlin.Int origin=null + @50:4..51:19 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @50:4..51:19 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:test.Test, :kotlin.Int) returnType:kotlin.Unit + @50:4..51:19 VALUE_PARAMETER name: type:test.Test + @50:4..51:19 VALUE_PARAMETER name: index:0 type:kotlin.Int + @50:4..51:19 BLOCK_BODY + @50:4..51:19 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test10 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null + @50:4..51:19 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @50:4..51:19 GET_VAR ': kotlin.Int declared in test.Test.' type=kotlin.Int origin=null + @54:4..57:9 PROPERTY name:test11 visibility:public modality:FINAL [var] + @54:4..57:9 FIELD PROPERTY_BACKING_FIELD name:test11 type:kotlin.Int visibility:private + @54:17..19 EXPRESSION_BODY + @54:17..19 CONST Int type=kotlin.Int value=42 + @54:4..57:9 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @54:4..57:9 VALUE_PARAMETER name: type:test.Test + @54:4..57:9 BLOCK_BODY + @54:4..57:9 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @54:4..57:9 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test11 type:kotlin.Int visibility:private' type=kotlin.Int origin=null + @54:4..57:9 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @54:4..57:9 FUN name: visibility:public modality:FINAL <> ($this:test.Test, value:kotlin.Int) returnType:kotlin.Unit + @54:4..57:9 VALUE_PARAMETER name: type:test.Test + @55:12..17 VALUE_PARAMETER name:value index:0 type:kotlin.Int + @55:19..57:9 BLOCK_BODY + @56:12..25 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test11 type:kotlin.Int visibility:private' type=kotlin.Unit origin=EQ + @56:12..25 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @56:20..25 GET_VAR 'value: kotlin.Int declared in test.Test.' type=kotlin.Int origin=null + @60:4..66:9 PROPERTY name:test12 visibility:public modality:FINAL [var] + @60:4..66:9 FIELD PROPERTY_BACKING_FIELD name:test12 type:kotlin.Int visibility:private + @60:17..19 EXPRESSION_BODY + @60:17..19 CONST Int type=kotlin.Int value=42 + @60:4..66:9 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @60:4..66:9 VALUE_PARAMETER name: type:test.Test + @60:4..66:9 BLOCK_BODY + @60:4..66:9 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @60:4..66:9 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test12 type:kotlin.Int visibility:private' type=kotlin.Int origin=null + @60:4..66:9 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @60:4..66:9 FUN name: visibility:public modality:FINAL <> ($this:test.Test, value:kotlin.Int) returnType:kotlin.Unit + @60:4..66:9 VALUE_PARAMETER name: type:test.Test + @64:12..17 VALUE_PARAMETER name:value index:0 type:kotlin.Int + @64:19..66:9 BLOCK_BODY + @65:12..25 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test12 type:kotlin.Int visibility:private' type=kotlin.Unit origin=EQ + @65:12..25 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @65:20..25 GET_VAR 'value: kotlin.Int declared in test.Test.' type=kotlin.Int origin=null + @69:4..75:9 PROPERTY name:test13 visibility:public modality:FINAL [var] + @69:4..75:9 FIELD PROPERTY_BACKING_FIELD name:test13 type:kotlin.Int visibility:private + @69:17..19 EXPRESSION_BODY + @69:17..19 CONST Int type=kotlin.Int value=42 + @69:4..75:9 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:test.Test) returnType:kotlin.Int + @69:4..75:9 VALUE_PARAMETER name: type:test.Test + @69:4..75:9 BLOCK_BODY + @69:4..75:9 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test.Test' + @69:4..75:9 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test13 type:kotlin.Int visibility:private' type=kotlin.Int origin=null + @69:4..75:9 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @69:4..75:9 FUN name: visibility:public modality:FINAL <> ($this:test.Test, value:kotlin.Int) returnType:kotlin.Unit + annotations: + @70:8..72:9 CONSTRUCTOR_CALL 'public constructor (vararg names: kotlin.String) [primary] declared in kotlin.Suppress' type=kotlin.Suppress origin=null + @71:12..29 VARARG type=kotlin.Array varargElementType=kotlin.String + @71:12..29 CONST String type=kotlin.String value="UNUSED_VARIABLE" + @69:4..75:9 VALUE_PARAMETER name: type:test.Test + @73:12..17 VALUE_PARAMETER name:value index:0 type:kotlin.Int + @73:19..75:9 BLOCK_BODY + @74:12..25 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test13 type:kotlin.Int visibility:private' type=kotlin.Unit origin=EQ + @74:12..25 GET_VAR ': test.Test declared in test.Test.' type=test.Test origin=null + @74:20..25 GET_VAR 'value: kotlin.Int declared in test.Test.' type=kotlin.Int origin=null + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @2:0..77:1 VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.Test diff --git a/compiler/testData/ir/sourceRanges/declarations/classes.fir.txt b/compiler/testData/ir/sourceRanges/declarations/classes.fir.txt new file mode 100644 index 00000000000..761ea87a4f4 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/declarations/classes.fir.txt @@ -0,0 +1,108 @@ +@0:0..23:0 FILE fqName: fileName:/classes.kt + @0:0..11 CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any] + @0:0..11 CONSTRUCTOR visibility:public <> () returnType:.Test1 [primary] + @0:0..11 BLOCK_BODY + @0:0..11 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @0:0..11 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @0:0..11 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + @3:0..4:11 CLASS CLASS name:Test2 modality:FINAL visibility:internal superTypes:[kotlin.Any] + @3:0..4:11 CONSTRUCTOR visibility:public <> () returnType:.Test2 [primary] + @3:0..4:11 BLOCK_BODY + @3:0..4:11 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @3:0..4:11 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:internal superTypes:[kotlin.Any]' + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @3:0..4:11 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + @10:0..11 CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any] + @10:0..11 CONSTRUCTOR visibility:public <> () returnType:.Test3 [primary] + @10:0..11 BLOCK_BODY + @10:0..11 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @10:0..11 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any]' + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @10:0..11 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 + @13:0..14:11 CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any] + annotations: + @13:0..23 CONSTRUCTOR_CALL 'public constructor (vararg names: kotlin.String) [primary] declared in kotlin.Suppress' type=kotlin.Suppress origin=null + @13:10..22 VARARG type=kotlin.Array varargElementType=kotlin.String + @13:10..22 CONST String type=kotlin.String value="UNUSED_VAR" + @13:0..14:11 CONSTRUCTOR visibility:public <> () returnType:.Test4 [primary] + @13:0..14:11 BLOCK_BODY + @13:0..14:11 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @13:0..14:11 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any]' + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @13:0..14:11 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test4 + @17:0..18:11 CLASS ENUM_CLASS name:Test5 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test5>] + @17:0..18:11 CONSTRUCTOR visibility:private <> () returnType:.Test5 [primary] + @17:0..18:11 BLOCK_BODY + @17:0..18:11 ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) [primary] declared in kotlin.Enum' + @17:0..18:11 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:Test5 modality:FINAL visibility:public superTypes:[kotlin.Enum<.Test5>]' + @17:0..18:11 FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.Test5> + @17:0..18:11 SYNTHETIC_BODY kind=ENUM_VALUES + @17:0..18:11 FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.Test5 + @17:0..18:11 VALUE_PARAMETER name:value index:0 type:kotlin.String + @17:0..18:11 SYNTHETIC_BODY kind=ENUM_VALUEOF + @17:0..18:11 PROPERTY ENUM_CLASS_SPECIAL_MEMBER name:entries visibility:public modality:FINAL [val] + @17:0..18:11 FUN ENUM_CLASS_SPECIAL_MEMBER name: visibility:public modality:FINAL <> () returnType:kotlin.enums.EnumEntries<.Test5> + @17:0..18:11 SYNTHETIC_BODY kind=ENUM_ENTRIES + @-1:-1..-1 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum<.Test5>) returnType:kotlin.Any [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Enum<.Test5> + @-1:-1..-1 FUN FAKE_OVERRIDE name:compareTo visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test5>, other:.Test5) returnType:kotlin.Int [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Enum<.Test5> + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:.Test5 + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test5>, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Enum<.Test5> + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test5>) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Enum<.Test5> + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Enum<.Test5>) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Enum<.Test5> + @-1:-1..-1 PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [fake_override,val] + annotations: + @-1:-1..-1 CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.internal.IntrinsicConstEvaluation' type=kotlin.internal.IntrinsicConstEvaluation origin=null + @-1:-1..-1 FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test5>) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Enum<.Test5> + @-1:-1..-1 PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [fake_override,val] + @-1:-1..-1 FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test5>) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Enum<.Test5> + @-1:-1..-1 FUN FAKE_OVERRIDE name:getDeclaringClass visibility:public modality:FINAL <> ($this:kotlin.Enum<.Test5>) returnType:@[FlexibleNullability] java.lang.Class<@[FlexibleNullability] .Test5?>? [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Enum<.Test5> + @-1:-1..-1 FUN FAKE_OVERRIDE name:finalize visibility:protected/*protected and package*/ modality:FINAL <> ($this:kotlin.Enum<.Test5>) returnType:kotlin.Unit [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Enum<.Test5> + @17:0..18:11 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test5 + @21:0..22:11 CLASS ANNOTATION_CLASS name:Test6 modality:OPEN visibility:public superTypes:[kotlin.Annotation] + @21:0..22:11 CONSTRUCTOR visibility:public <> () returnType:.Test6 [primary] + @21:0..22:11 BLOCK_BODY + @21:0..22:11 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @21:0..22:11 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:Test6 modality:OPEN visibility:public superTypes:[kotlin.Annotation]' + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @21:0..22:11 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test6 diff --git a/compiler/testData/ir/sourceRanges/declarations/fakeOverrides.fir.txt b/compiler/testData/ir/sourceRanges/declarations/fakeOverrides.fir.txt new file mode 100644 index 00000000000..a27543d1201 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/declarations/fakeOverrides.fir.txt @@ -0,0 +1,14 @@ +@0:0..1:0 FILE fqName: fileName:/fakeOverrides.kt + @0:0..10 CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any] + @0:0..10 CONSTRUCTOR visibility:public <> () returnType:.Test [primary] + @0:0..10 BLOCK_BODY + @0:0..10 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @0:0..10 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[kotlin.Any]' + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @0:0..10 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test diff --git a/compiler/testData/ir/sourceRanges/declarations/kt29862.fir.txt b/compiler/testData/ir/sourceRanges/declarations/kt29862.fir.txt new file mode 100644 index 00000000000..1f7d59e175e --- /dev/null +++ b/compiler/testData/ir/sourceRanges/declarations/kt29862.fir.txt @@ -0,0 +1,74 @@ +@0:0..15:0 FILE fqName: fileName:/kt29862.kt + @0:0..3:1 CLASS CLASS name:Test1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + @0:20..2:1 CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test1 [primary] + @1:4..14 VALUE_PARAMETER name:x index:0 type:kotlin.Int + @0:20..2:1 BLOCK_BODY + @0:0..3:1 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @0:20..2:1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + @1:4..14 PROPERTY name:x visibility:public modality:FINAL [val] + @1:4..14 FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + @1:4..14 EXPRESSION_BODY + @1:4..14 GET_VAR 'x: kotlin.Int declared in .Test1.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + @1:4..14 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int + @1:4..14 VALUE_PARAMETER name: type:.Test1 + @1:4..14 BLOCK_BODY + @1:4..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test1' + @1:4..14 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @1:4..14 GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @0:0..3:1 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + @5:0..14:1 CLASS CLASS name:Test2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + @7:11..9:1 CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test2 [primary] + @8:4..14 VALUE_PARAMETER name:x index:0 type:kotlin.Int + @7:11..9:1 BLOCK_BODY + @5:0..14:1 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @7:11..9:1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + @8:4..14 PROPERTY name:x visibility:public modality:FINAL [val] + @8:4..14 FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + @8:4..14 EXPRESSION_BODY + @8:4..14 GET_VAR 'x: kotlin.Int declared in .Test2.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + @8:4..14 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int + @8:4..14 VALUE_PARAMETER name: type:.Test2 + @8:4..14 BLOCK_BODY + @8:4..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test2' + @8:4..14 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @8:4..14 GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + @10:4..13:5 CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] + @11:19..13:5 CONSTRUCTOR visibility:public <> ($this:.Test2, x:kotlin.Int) returnType:.Test2.TestInner [primary] + @11:19..13:5 VALUE_PARAMETER name: type:.Test2 + @12:8..18 VALUE_PARAMETER name:x index:0 type:kotlin.Int + @11:19..13:5 BLOCK_BODY + @10:4..13:5 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @11:19..13:5 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInner modality:FINAL visibility:public [inner] superTypes:[kotlin.Any]' + @12:8..18 PROPERTY name:x visibility:public modality:FINAL [val] + @12:8..18 FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + @12:8..18 EXPRESSION_BODY + @12:8..18 GET_VAR 'x: kotlin.Int declared in .Test2.TestInner.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + @12:8..18 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2.TestInner) returnType:kotlin.Int + @12:8..18 VALUE_PARAMETER name: type:.Test2.TestInner + @12:8..18 BLOCK_BODY + @12:8..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test2.TestInner' + @12:8..18 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @12:8..18 GET_VAR ': .Test2.TestInner declared in .Test2.TestInner.' type=.Test2.TestInner origin=null + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @10:4..13:5 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2.TestInner + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @5:0..14:1 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 diff --git a/compiler/testData/ir/sourceRanges/declarations/primaryConstructors.fir.txt b/compiler/testData/ir/sourceRanges/declarations/primaryConstructors.fir.txt new file mode 100644 index 00000000000..af1309b99d2 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/declarations/primaryConstructors.fir.txt @@ -0,0 +1,101 @@ +@0:0..14:0 FILE fqName: fileName:/primaryConstructors.kt + @0:0..23 CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any] + @0:11..23 CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test1 [primary] + @0:12..22 VALUE_PARAMETER name:x index:0 type:kotlin.Int + @0:11..23 BLOCK_BODY + @0:0..23 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @0:11..23 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Any]' + @0:12..22 PROPERTY name:x visibility:public modality:FINAL [val] + @0:12..22 FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + @0:12..22 EXPRESSION_BODY + @0:12..22 GET_VAR 'x: kotlin.Int declared in .Test1.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + @0:12..22 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int + @0:12..22 VALUE_PARAMETER name: type:.Test1 + @0:12..22 BLOCK_BODY + @0:12..22 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test1' + @0:12..22 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @0:12..22 GET_VAR ': .Test1 declared in .Test1.' type=.Test1 origin=null + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @0:0..23 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 + @2:0..3:32 CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any] + @3:0..32 CONSTRUCTOR visibility:internal <> (x:kotlin.Int) returnType:.Test2 [primary] + @3:21..31 VALUE_PARAMETER name:x index:0 type:kotlin.Int + @3:0..32 BLOCK_BODY + @2:0..3:32 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @3:0..32 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Any]' + @3:21..31 PROPERTY name:x visibility:public modality:FINAL [val] + @3:21..31 FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + @3:21..31 EXPRESSION_BODY + @3:21..31 GET_VAR 'x: kotlin.Int declared in .Test2.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + @3:21..31 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int + @3:21..31 VALUE_PARAMETER name: type:.Test2 + @3:21..31 BLOCK_BODY + @3:21..31 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test2' + @3:21..31 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @3:21..31 GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @2:0..3:32 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 + @5:0..9:23 CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any] + @9:0..23 CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test3 [primary] + @9:12..22 VALUE_PARAMETER name:x index:0 type:kotlin.Int + @9:0..23 BLOCK_BODY + @5:0..9:23 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @9:0..23 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test3 modality:FINAL visibility:public superTypes:[kotlin.Any]' + @9:12..22 PROPERTY name:x visibility:public modality:FINAL [val] + @9:12..22 FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + @9:12..22 EXPRESSION_BODY + @9:12..22 GET_VAR 'x: kotlin.Int declared in .Test3.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + @9:12..22 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test3) returnType:kotlin.Int + @9:12..22 VALUE_PARAMETER name: type:.Test3 + @9:12..22 BLOCK_BODY + @9:12..22 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test3' + @9:12..22 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @9:12..22 GET_VAR ': .Test3 declared in .Test3.' type=.Test3 origin=null + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @5:0..9:23 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test3 + @11:0..13:23 CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any] + @12:0..13:23 CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.Test4 [primary] + annotations: + @12:0..28 CONSTRUCTOR_CALL 'public constructor (vararg names: kotlin.String) [primary] declared in kotlin.Suppress' type=kotlin.Suppress origin=null + @12:10..27 VARARG type=kotlin.Array varargElementType=kotlin.String + @12:10..27 CONST String type=kotlin.String value="UNUSED_VARIABLE" + @13:12..22 VALUE_PARAMETER name:x index:0 type:kotlin.Int + @12:0..13:23 BLOCK_BODY + @11:0..13:23 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @12:0..13:23 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test4 modality:FINAL visibility:public superTypes:[kotlin.Any]' + @13:12..22 PROPERTY name:x visibility:public modality:FINAL [val] + @13:12..22 FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + @13:12..22 EXPRESSION_BODY + @13:12..22 GET_VAR 'x: kotlin.Int declared in .Test4.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + @13:12..22 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test4) returnType:kotlin.Int + @13:12..22 VALUE_PARAMETER name: type:.Test4 + @13:12..22 BLOCK_BODY + @13:12..22 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test4' + @13:12..22 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @13:12..22 GET_VAR ': .Test4 declared in .Test4.' type=.Test4 origin=null + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @11:0..13:23 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test4 diff --git a/compiler/testData/ir/sourceRanges/declarations/secondaryConstructors.fir.txt b/compiler/testData/ir/sourceRanges/declarations/secondaryConstructors.fir.txt new file mode 100644 index 00000000000..3db3a2a9124 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/declarations/secondaryConstructors.fir.txt @@ -0,0 +1,33 @@ +@0:0..14:0 FILE fqName: fileName:/secondaryConstructors.kt + @0:0..13:1 CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] + @1:4..27 CONSTRUCTOR visibility:public <> () returnType:.C + @1:4..27 BLOCK_BODY + @1:20..27 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @1:4..27 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + @3:4..4:32 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.C + @4:16..22 VALUE_PARAMETER name:x index:0 type:kotlin.Int + @3:4..4:32 BLOCK_BODY + @4:25..32 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @3:4..4:32 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + @9:4..36 CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.C + @9:16..25 VALUE_PARAMETER name:x index:0 type:kotlin.String + @9:4..36 BLOCK_BODY + @9:29..36 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @9:4..36 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + @11:4..12:32 CONSTRUCTOR visibility:public <> (x:kotlin.Any) returnType:.C + annotations: + @11:4..32 CONSTRUCTOR_CALL 'public constructor (vararg names: kotlin.String) [primary] declared in kotlin.Suppress' type=kotlin.Suppress origin=null + @11:14..31 VARARG type=kotlin.Array varargElementType=kotlin.String + @11:14..31 CONST String type=kotlin.String value="UNUSED_VARIABLE" + @12:16..22 VALUE_PARAMETER name:x index:0 type:kotlin.Any + @11:4..12:32 BLOCK_BODY + @12:25..32 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @11:4..12:32 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @0:0..13:1 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C diff --git a/compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.fir.txt b/compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.fir.txt new file mode 100644 index 00000000000..a30bc19ee10 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/declarations/synthesizedDataClassMembers.fir.txt @@ -0,0 +1,173 @@ +@0:0..5:0 FILE fqName: fileName:/synthesizedDataClassMembers.kt + @0:0..4:1 CLASS CLASS name:C modality:FINAL visibility:public [data] superTypes:[kotlin.Any] + @0:12..4:1 CONSTRUCTOR visibility:public <> (x:kotlin.Int, y:kotlin.String, z:kotlin.Any) returnType:.C [primary] + @1:8..18 VALUE_PARAMETER name:x index:0 type:kotlin.Int + @2:8..21 VALUE_PARAMETER name:y index:1 type:kotlin.String + @3:8..18 VALUE_PARAMETER name:z index:2 type:kotlin.Any + @0:12..4:1 BLOCK_BODY + @0:0..4:1 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + @0:12..4:1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' + @1:8..18 PROPERTY name:x visibility:public modality:FINAL [val] + @1:8..18 FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] + @1:8..18 EXPRESSION_BODY + @1:8..18 GET_VAR 'x: kotlin.Int declared in .C.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER + @1:8..18 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + @1:8..18 VALUE_PARAMETER name: type:.C + @1:8..18 BLOCK_BODY + @1:8..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' + @1:8..18 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @1:8..18 GET_VAR ': .C declared in .C.' type=.C origin=null + @2:8..21 PROPERTY name:y visibility:public modality:FINAL [val] + @2:8..21 FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final] + @2:8..21 EXPRESSION_BODY + @2:8..21 GET_VAR 'y: kotlin.String declared in .C.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + @2:8..21 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.String + @2:8..21 VALUE_PARAMETER name: type:.C + @2:8..21 BLOCK_BODY + @2:8..21 RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .C' + @2:8..21 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + @2:8..21 GET_VAR ': .C declared in .C.' type=.C origin=null + @3:8..18 PROPERTY name:z visibility:public modality:FINAL [val] + @3:8..18 FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final] + @3:8..18 EXPRESSION_BODY + @3:8..18 GET_VAR 'z: kotlin.Any declared in .C.' type=kotlin.Any origin=INITIALIZE_PROPERTY_FROM_PARAMETER + @3:8..18 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Any + @3:8..18 VALUE_PARAMETER name: type:.C + @3:8..18 BLOCK_BODY + @3:8..18 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .C' + @3:8..18 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + @3:8..18 GET_VAR ': .C declared in .C.' type=.C origin=null + @1:8..18 FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int [operator] + @1:8..18 VALUE_PARAMETER name: type:.C + @0:0..0 BLOCK_BODY + @0:0..0 RETURN type=kotlin.Nothing from='public final fun component1 (): kotlin.Int [operator] declared in .C' + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @0:0..0 GET_VAR ': .C declared in .C.component1' type=.C origin=null + @2:8..21 FUN GENERATED_DATA_CLASS_MEMBER name:component2 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.String [operator] + @2:8..21 VALUE_PARAMETER name: type:.C + @0:0..0 BLOCK_BODY + @0:0..0 RETURN type=kotlin.Nothing from='public final fun component2 (): kotlin.String [operator] declared in .C' + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + @0:0..0 GET_VAR ': .C declared in .C.component2' type=.C origin=null + @3:8..18 FUN GENERATED_DATA_CLASS_MEMBER name:component3 visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Any [operator] + @3:8..18 VALUE_PARAMETER name: type:.C + @0:0..0 BLOCK_BODY + @0:0..0 RETURN type=kotlin.Nothing from='public final fun component3 (): kotlin.Any [operator] declared in .C' + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + @0:0..0 GET_VAR ': .C declared in .C.component3' type=.C origin=null + @0:0..4:1 FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:.C, x:kotlin.Int, y:kotlin.String, z:kotlin.Any) returnType:.C + @0:0..4:1 VALUE_PARAMETER name: type:.C + @1:8..18 VALUE_PARAMETER name:x index:0 type:kotlin.Int + @0:0..0 EXPRESSION_BODY + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @0:0..0 GET_VAR ': .C declared in .C.copy' type=.C origin=null + @2:8..21 VALUE_PARAMETER name:y index:1 type:kotlin.String + @0:0..0 EXPRESSION_BODY + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + @0:0..0 GET_VAR ': .C declared in .C.copy' type=.C origin=null + @3:8..18 VALUE_PARAMETER name:z index:2 type:kotlin.Any + @0:0..0 EXPRESSION_BODY + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + @0:0..0 GET_VAR ': .C declared in .C.copy' type=.C origin=null + @0:0..0 BLOCK_BODY + @0:0..0 RETURN type=kotlin.Nothing from='public final fun copy (x: kotlin.Int, y: kotlin.String, z: kotlin.Any): .C declared in .C' + @0:0..0 CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int, y: kotlin.String, z: kotlin.Any) [primary] declared in .C' type=.C origin=null + @0:0..0 GET_VAR 'x: kotlin.Int declared in .C.copy' type=kotlin.Int origin=null + @0:0..0 GET_VAR 'y: kotlin.String declared in .C.copy' type=kotlin.String origin=null + @0:0..0 GET_VAR 'z: kotlin.Any declared in .C.copy' type=kotlin.Any origin=null + @-1:-1..-1 FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String + @-1:-1..-1 VALUE_PARAMETER name: type:.C + @0:0..0 BLOCK_BODY + @0:0..0 RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .C' + @0:0..0 STRING_CONCATENATION type=kotlin.String + @0:0..0 CONST String type=kotlin.String value="C(" + @0:0..0 CONST String type=kotlin.String value="x=" + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @0:0..0 GET_VAR ': .C declared in .C.toString' type=.C origin=null + @0:0..0 CONST String type=kotlin.String value=", " + @0:0..0 CONST String type=kotlin.String value="y=" + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + @0:0..0 GET_VAR ': .C declared in .C.toString' type=.C origin=null + @0:0..0 CONST String type=kotlin.String value=", " + @0:0..0 CONST String type=kotlin.String value="z=" + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + @0:0..0 GET_VAR ': .C declared in .C.toString' type=.C origin=null + @0:0..0 CONST String type=kotlin.String value=")" + @-1:-1..-1 FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Int + @-1:-1..-1 VALUE_PARAMETER name: type:.C + @0:0..0 BLOCK_BODY + @0:0..0 VAR name:result type:kotlin.Int [var] + @0:0..0 CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.Int' type=kotlin.Int origin=null + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @0:0..0 GET_VAR ': .C declared in .C.hashCode' type=.C origin=null + @0:0..0 SET_VAR 'var result: kotlin.Int [var] declared in .C.hashCode' type=kotlin.Unit origin=EQ + @0:0..0 CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + @0:0..0 CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + @0:0..0 GET_VAR 'var result: kotlin.Int [var] declared in .C.hashCode' type=kotlin.Int origin=null + @0:0..0 CONST Int type=kotlin.Int value=31 + @0:0..0 CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.String' type=kotlin.Int origin=null + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + @0:0..0 GET_VAR ': .C declared in .C.hashCode' type=.C origin=null + @0:0..0 SET_VAR 'var result: kotlin.Int [var] declared in .C.hashCode' type=kotlin.Unit origin=EQ + @0:0..0 CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + @0:0..0 CALL 'public final fun times (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + @0:0..0 GET_VAR 'var result: kotlin.Int [var] declared in .C.hashCode' type=kotlin.Int origin=null + @0:0..0 CONST Int type=kotlin.Int value=31 + @0:0..0 CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + @0:0..0 GET_VAR ': .C declared in .C.hashCode' type=.C origin=null + @0:0..0 RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .C' + @0:0..0 GET_VAR 'var result: kotlin.Int [var] declared in .C.hashCode' type=kotlin.Int origin=null + @-1:-1..-1 FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.C, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + @-1:-1..-1 VALUE_PARAMETER name: type:.C + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @0:0..0 BLOCK_BODY + @0:0..0 WHEN type=kotlin.Unit origin=null + @0:0..0 BRANCH + @0:0..0 CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ + @0:0..0 GET_VAR ': .C declared in .C.equals' type=.C origin=null + @0:0..0 GET_VAR 'other: kotlin.Any? declared in .C.equals' type=kotlin.Any? origin=null + @0:0..0 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .C' + @0:0..0 CONST Boolean type=kotlin.Boolean value=true + @0:0..0 WHEN type=kotlin.Unit origin=null + @0:0..0 BRANCH + @0:0..0 TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.C + @0:0..0 GET_VAR 'other: kotlin.Any? declared in .C.equals' type=kotlin.Any? origin=null + @0:0..0 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .C' + @0:0..0 CONST Boolean type=kotlin.Boolean value=false + @0:0..0 VAR IR_TEMPORARY_VARIABLE name:tmp0_other_with_cast type:.C [val] + @0:0..0 TYPE_OP type=.C origin=CAST typeOperand=.C + @0:0..0 GET_VAR 'other: kotlin.Any? declared in .C.equals' type=kotlin.Any? origin=null + @0:0..0 WHEN type=kotlin.Unit origin=null + @0:0..0 BRANCH + @0:0..0 CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + @0:0..0 CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @0:0..0 GET_VAR ': .C declared in .C.equals' type=.C origin=null + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null + @0:0..0 GET_VAR 'val tmp0_other_with_cast: .C [val] declared in .C.equals' type=.C origin=null + @0:0..0 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .C' + @0:0..0 CONST Boolean type=kotlin.Boolean value=false + @0:0..0 WHEN type=kotlin.Unit origin=null + @0:0..0 BRANCH + @0:0..0 CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + @0:0..0 CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + @0:0..0 GET_VAR ': .C declared in .C.equals' type=.C origin=null + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:y type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + @0:0..0 GET_VAR 'val tmp0_other_with_cast: .C [val] declared in .C.equals' type=.C origin=null + @0:0..0 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .C' + @0:0..0 CONST Boolean type=kotlin.Boolean value=false + @0:0..0 WHEN type=kotlin.Unit origin=null + @0:0..0 BRANCH + @0:0..0 CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ + @0:0..0 CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + @0:0..0 GET_VAR ': .C declared in .C.equals' type=.C origin=null + @0:0..0 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null + @0:0..0 GET_VAR 'val tmp0_other_with_cast: .C [val] declared in .C.equals' type=.C origin=null + @0:0..0 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .C' + @0:0..0 CONST Boolean type=kotlin.Boolean value=false + @0:0..0 RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .C' + @0:0..0 CONST Boolean type=kotlin.Boolean value=true + @0:0..4:1 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C diff --git a/compiler/testData/ir/sourceRanges/declarations/topLevelFuns.fir.txt b/compiler/testData/ir/sourceRanges/declarations/topLevelFuns.fir.txt new file mode 100644 index 00000000000..d490b63f224 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/declarations/topLevelFuns.fir.txt @@ -0,0 +1,13 @@ +@0:0..20:0 FILE fqName:test fileName:/topLevelFuns.kt + @3:0..14 FUN name:test0 visibility:public modality:FINAL <> () returnType:kotlin.Unit + @3:12..14 BLOCK_BODY + @9:0..14 FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit + @9:12..14 BLOCK_BODY + @12:0..15:14 FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit + annotations: + @12:0..14:1 CONSTRUCTOR_CALL 'public constructor (vararg names: kotlin.String) [primary] declared in kotlin.Suppress' type=kotlin.Suppress origin=null + @13:4..21 VARARG type=kotlin.Array varargElementType=kotlin.String + @13:4..21 CONST String type=kotlin.String value="UNUSED_VARIABLE" + @15:12..14 BLOCK_BODY + @18:0..19:14 FUN name:test3 visibility:private modality:FINAL <> () returnType:kotlin.Unit + @19:12..14 BLOCK_BODY diff --git a/compiler/testData/ir/sourceRanges/declarations/topLevelProperties.fir.txt b/compiler/testData/ir/sourceRanges/declarations/topLevelProperties.fir.txt new file mode 100644 index 00000000000..bb1453998b5 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/declarations/topLevelProperties.fir.txt @@ -0,0 +1,143 @@ +@0:0..69:0 FILE fqName:test fileName:/topLevelProperties.kt + @3:0..14 PROPERTY name:test0 visibility:public modality:FINAL [val] + @3:0..14 FIELD PROPERTY_BACKING_FIELD name:test0 type:kotlin.Int visibility:private [final,static] + @3:12..14 EXPRESSION_BODY + @3:12..14 CONST Int type=kotlin.Int value=42 + @3:0..14 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + @3:0..14 BLOCK_BODY + @3:0..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @3:0..14 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test0 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null + @9:0..14 PROPERTY name:test1 visibility:public modality:FINAL [val] + @9:0..14 FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final,static] + @9:12..14 EXPRESSION_BODY + @9:12..14 CONST Int type=kotlin.Int value=42 + @9:0..14 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + @9:0..14 BLOCK_BODY + @9:0..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @9:0..14 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null + @12:0..15:14 PROPERTY name:test2 visibility:public modality:FINAL [val] + annotations: + @12:0..14:1 CONSTRUCTOR_CALL 'public constructor (vararg names: kotlin.String) [primary] declared in kotlin.Suppress' type=kotlin.Suppress origin=null + @13:4..21 VARARG type=kotlin.Array varargElementType=kotlin.String + @13:4..21 CONST String type=kotlin.String value="UNUSED_VARIABLE" + @12:0..15:14 FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:private [final,static] + @15:12..14 EXPRESSION_BODY + @15:12..14 CONST Int type=kotlin.Int value=42 + @12:0..15:14 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + @12:0..15:14 BLOCK_BODY + @12:0..15:14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @12:0..15:14 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null + @18:0..19:14 PROPERTY name:test3 visibility:private modality:FINAL [val] + @18:0..19:14 FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private [final,static] + @19:12..14 EXPRESSION_BODY + @19:12..14 CONST Int type=kotlin.Int value=42 + @18:0..19:14 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> () returnType:kotlin.Int + @18:0..19:14 BLOCK_BODY + @18:0..19:14 RETURN type=kotlin.Nothing from='private final fun (): kotlin.Int declared in test' + @18:0..19:14 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null + @22:0..20 PROPERTY name:test4 visibility:public modality:FINAL [val] + @22:0..20 FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + @22:18..20 BLOCK_BODY + @22:20..20 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @22:18..20 CONST Int type=kotlin.Int value=42 + @25:0..26:14 PROPERTY name:test5 visibility:public modality:FINAL [val] + @25:0..26:14 FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + @26:12..14 BLOCK_BODY + @26:14..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @26:12..14 CONST Int type=kotlin.Int value=42 + @29:0..33:14 PROPERTY name:test6 visibility:public modality:FINAL [val] + @29:0..33:14 FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + @33:12..14 BLOCK_BODY + @33:14..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @33:12..14 CONST Int type=kotlin.Int value=42 + @36:0..40:14 PROPERTY name:test7 visibility:public modality:FINAL [val] + @36:0..40:14 FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + annotations: + @37:4..39:5 CONSTRUCTOR_CALL 'public constructor (vararg names: kotlin.String) [primary] declared in kotlin.Suppress' type=kotlin.Suppress origin=null + @38:8..25 VARARG type=kotlin.Array varargElementType=kotlin.String + @38:8..25 CONST String type=kotlin.String value="UNUSED_VARIABLE" + @40:12..14 BLOCK_BODY + @40:14..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @40:12..14 CONST Int type=kotlin.Int value=42 + @43:0..14 PROPERTY name:test8 visibility:public modality:FINAL [var] + @43:0..14 FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Int visibility:private [static] + @43:12..14 EXPRESSION_BODY + @43:12..14 CONST Int type=kotlin.Int value=42 + @43:0..14 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + @43:0..14 BLOCK_BODY + @43:0..14 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @43:0..14 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + @43:0..14 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + @43:0..14 VALUE_PARAMETER name: index:0 type:kotlin.Int + @43:0..14 BLOCK_BODY + @43:0..14 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null + @43:0..14 GET_VAR ': kotlin.Int declared in test.' type=kotlin.Int origin=null + @46:0..27 PROPERTY name:test9 visibility:public modality:FINAL [var] + @46:0..27 FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Int visibility:private [static] + @46:12..14 EXPRESSION_BODY + @46:12..14 CONST Int type=kotlin.Int value=42 + @46:0..27 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + @46:0..27 BLOCK_BODY + @46:0..27 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @46:0..27 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + @46:0..27 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + @46:0..27 VALUE_PARAMETER name: index:0 type:kotlin.Int + @46:0..27 BLOCK_BODY + @46:0..27 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test9 type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null + @46:0..27 GET_VAR ': kotlin.Int declared in test.' type=kotlin.Int origin=null + @49:0..50:15 PROPERTY name:test10 visibility:public modality:FINAL [var] + @49:0..50:15 FIELD PROPERTY_BACKING_FIELD name:test10 type:kotlin.Int visibility:private [static] + @49:13..15 EXPRESSION_BODY + @49:13..15 CONST Int type=kotlin.Int value=42 + @49:0..50:15 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + @49:0..50:15 BLOCK_BODY + @49:0..50:15 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @49:0..50:15 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test10 type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + @49:0..50:15 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + @49:0..50:15 VALUE_PARAMETER name: index:0 type:kotlin.Int + @49:0..50:15 BLOCK_BODY + @49:0..50:15 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test10 type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null + @49:0..50:15 GET_VAR ': kotlin.Int declared in test.' type=kotlin.Int origin=null + @53:0..54:32 PROPERTY name:test11 visibility:public modality:FINAL [var] + @53:0..54:32 FIELD PROPERTY_BACKING_FIELD name:test11 type:kotlin.Int visibility:private [static] + @53:13..15 EXPRESSION_BODY + @53:13..15 CONST Int type=kotlin.Int value=42 + @53:0..54:32 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + @53:0..54:32 BLOCK_BODY + @53:0..54:32 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @53:0..54:32 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test11 type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + @53:0..54:32 FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit + @54:8..13 VALUE_PARAMETER name:value index:0 type:kotlin.Int + @54:15..32 BLOCK_BODY + @54:17..30 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test11 type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=EQ + @54:25..30 GET_VAR 'value: kotlin.Int declared in test.' type=kotlin.Int origin=null + @57:0..61:32 PROPERTY name:test12 visibility:public modality:FINAL [var] + @57:0..61:32 FIELD PROPERTY_BACKING_FIELD name:test12 type:kotlin.Int visibility:private [static] + @57:13..15 EXPRESSION_BODY + @57:13..15 CONST Int type=kotlin.Int value=42 + @57:0..61:32 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + @57:0..61:32 BLOCK_BODY + @57:0..61:32 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @57:0..61:32 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test12 type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + @57:0..61:32 FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit + @61:8..13 VALUE_PARAMETER name:value index:0 type:kotlin.Int + @61:15..32 BLOCK_BODY + @61:17..30 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test12 type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=EQ + @61:25..30 GET_VAR 'value: kotlin.Int declared in test.' type=kotlin.Int origin=null + @64:0..68:32 PROPERTY name:test13 visibility:public modality:FINAL [var] + @64:0..68:32 FIELD PROPERTY_BACKING_FIELD name:test13 type:kotlin.Int visibility:private [static] + @64:13..15 EXPRESSION_BODY + @64:13..15 CONST Int type=kotlin.Int value=42 + @64:0..68:32 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + @64:0..68:32 BLOCK_BODY + @64:0..68:32 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' + @64:0..68:32 GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test13 type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + @64:0..68:32 FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit + annotations: + @65:4..67:5 CONSTRUCTOR_CALL 'public constructor (vararg names: kotlin.String) [primary] declared in kotlin.Suppress' type=kotlin.Suppress origin=null + @66:8..25 VARARG type=kotlin.Array varargElementType=kotlin.String + @66:8..25 CONST String type=kotlin.String value="UNUSED_VARIABLE" + @68:8..13 VALUE_PARAMETER name:value index:0 type:kotlin.Int + @68:15..32 BLOCK_BODY + @68:17..30 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test13 type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=EQ + @68:25..30 GET_VAR 'value: kotlin.Int declared in test.' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/sourceRanges/elvis.fir.txt b/compiler/testData/ir/sourceRanges/elvis.fir.txt new file mode 100644 index 00000000000..9146d366bd1 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/elvis.fir.txt @@ -0,0 +1,20 @@ +@0:0..3:0 FILE fqName: fileName:/elvis.kt + @0:0..23 FUN name:intN visibility:public modality:FINAL <> () returnType:kotlin.Int? + @0:19..23 BLOCK_BODY + @0:23..23 RETURN type=kotlin.Nothing from='public final fun intN (): kotlin.Int? declared in ' + @0:19..23 CONST Null type=kotlin.Nothing? value=null + @2:0..24 FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Int + @2:13..24 BLOCK_BODY + @2:24..24 RETURN type=kotlin.Nothing from='public final fun test (): kotlin.Int declared in ' + @2:13..24 BLOCK type=kotlin.Int origin=ELVIS + @2:13..24 VAR IR_TEMPORARY_VARIABLE name: type:kotlin.Int? [val] + @2:13..19 CALL 'public final fun intN (): kotlin.Int? declared in ' type=kotlin.Int? origin=null + @2:13..24 WHEN type=kotlin.Int origin=null + @2:13..24 BRANCH + @2:13..24 CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ + @2:13..24 GET_VAR 'val : kotlin.Int? [val] declared in .test' type=kotlin.Int? origin=null + @2:13..24 CONST Null type=kotlin.Nothing? value=null + @2:23..24 CONST Int type=kotlin.Int value=1 + @2:13..24 BRANCH + @2:13..24 CONST Boolean type=kotlin.Boolean value=true + @2:13..24 GET_VAR 'val : kotlin.Int? [val] declared in .test' type=kotlin.Int? origin=null diff --git a/compiler/testData/ir/sourceRanges/kt17108.fir.txt b/compiler/testData/ir/sourceRanges/kt17108.fir.txt new file mode 100644 index 00000000000..392132e133d --- /dev/null +++ b/compiler/testData/ir/sourceRanges/kt17108.fir.txt @@ -0,0 +1,24 @@ +@0:0..27:0 FILE fqName: fileName:/kt17108.kt + @4:0..26:1 CLASS INTERFACE name:Boolean modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + @8:4..38 FUN name:not visibility:public modality:ABSTRACT <> ($this:.Boolean) returnType:.Boolean [operator] + @8:4..38 VALUE_PARAMETER name: type:.Boolean + @13:4..42 FUN name:and visibility:public modality:ABSTRACT <> ($this:.Boolean, other:.Boolean) returnType:.Boolean [infix] + @13:4..42 VALUE_PARAMETER name: type:.Boolean + @13:18..32 VALUE_PARAMETER name:other index:0 type:.Boolean + @18:4..41 FUN name:or visibility:public modality:ABSTRACT <> ($this:.Boolean, other:.Boolean) returnType:.Boolean [infix] + @18:4..41 VALUE_PARAMETER name: type:.Boolean + @18:17..31 VALUE_PARAMETER name:other index:0 type:.Boolean + @23:4..42 FUN name:xor visibility:public modality:ABSTRACT <> ($this:.Boolean, other:.Boolean) returnType:.Boolean [infix] + @23:4..42 VALUE_PARAMETER name: type:.Boolean + @23:18..32 VALUE_PARAMETER name:other index:0 type:.Boolean + @25:4..38 FUN name:compareTo visibility:public modality:ABSTRACT <> ($this:.Boolean, other:.Boolean) returnType:kotlin.Int + @25:4..38 VALUE_PARAMETER name: type:.Boolean + @25:18..32 VALUE_PARAMETER name:other index:0 type:.Boolean + @-1:-1..-1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 VALUE_PARAMETER name:other index:0 type:kotlin.Any? + @-1:-1..-1 FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @-1:-1..-1 FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + @-1:-1..-1 VALUE_PARAMETER name: type:kotlin.Any + @4:0..26:1 VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Boolean diff --git a/compiler/testData/ir/sourceRanges/kt24258.fir.txt b/compiler/testData/ir/sourceRanges/kt24258.fir.txt new file mode 100644 index 00000000000..193a75192d1 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/kt24258.fir.txt @@ -0,0 +1,22 @@ +@0:0..9:0 FILE fqName: fileName:/kt24258.kt + @3:0..53 PROPERTY name:lazyNullString visibility:public modality:FINAL [delegated,val] + @3:0..53 FIELD PROPERTY_DELEGATE name:lazyNullString$delegate type:kotlin.Lazy<@[FlexibleNullability] kotlin.String?> visibility:private [final,static] + @3:30..53 EXPRESSION_BODY + @3:30..53 CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy<@[FlexibleNullability] kotlin.String?> origin=null + @3:35..53 FUN_EXPR type=kotlin.Function0<@[FlexibleNullability] kotlin.String?> origin=LAMBDA + @3:35..53 FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:@[FlexibleNullability] kotlin.String? + @3:37..51 BLOCK_BODY + @3:51..51 RETURN type=kotlin.Nothing from='local final fun (): @[FlexibleNullability] kotlin.String? declared in .lazyNullString$delegate' + @3:39..51 CALL 'public open fun nullString (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null + @3:0..53 FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + @3:30..53 BLOCK_BODY + @3:30..53 RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' + @3:30..53 TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String + @3:30..53 CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue [inline,operator] declared in kotlin' type=@[FlexibleNullability] kotlin.String? origin=null + @-1:-1..3:53 GET_FIELD 'FIELD PROPERTY_DELEGATE name:lazyNullString$delegate type:kotlin.Lazy<@[FlexibleNullability] kotlin.String?> visibility:private [final,static]' type=kotlin.Lazy<@[FlexibleNullability] kotlin.String?> origin=null + @-1:-1..-1 CONST Null type=kotlin.Nothing? value=null + @3:30..53 PROPERTY_REFERENCE 'public final lazyNullString: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE + @5:0..7:1 FUN name:testLazyNullString visibility:public modality:FINAL <> () returnType:kotlin.Unit + @5:25..7:1 BLOCK_BODY + @6:4..34 VAR name:s type:kotlin.String [val] + @6:20..34 CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=GET_PROPERTY diff --git a/compiler/testData/ir/sourceRanges/postfixIncrementDecrement.fir.txt b/compiler/testData/ir/sourceRanges/postfixIncrementDecrement.fir.txt new file mode 100644 index 00000000000..44929ea6697 --- /dev/null +++ b/compiler/testData/ir/sourceRanges/postfixIncrementDecrement.fir.txt @@ -0,0 +1,23 @@ +@0:0..6:0 FILE fqName: fileName:/postfixIncrementDecrement.kt + @0:0..5:1 FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit + @0:11..5:1 BLOCK_BODY + @1:4..13 VAR name:x type:kotlin.Int [var] + @1:12..13 CONST Int type=kotlin.Int value=0 + @2:4..13 VAR name:y type:kotlin.Int [var] + @2:12..13 CONST Int type=kotlin.Int value=0 + @3:4..11 SET_VAR 'var y: kotlin.Int [var] declared in .test' type=kotlin.Unit origin=EQ + @3:8..11 BLOCK type=kotlin.Int origin=POSTFIX_INCR + @3:8..11 VAR IR_TEMPORARY_VARIABLE name: type:kotlin.Int [val] + @3:8..9 GET_VAR 'var x: kotlin.Int [var] declared in .test' type=kotlin.Int origin=null + @3:8..11 SET_VAR 'var x: kotlin.Int [var] declared in .test' type=kotlin.Unit origin=POSTFIX_INCR + @3:9..11 CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + @3:8..11 GET_VAR 'val : kotlin.Int [val] declared in .test' type=kotlin.Int origin=null + @3:8..11 GET_VAR 'val : kotlin.Int [val] declared in .test' type=kotlin.Int origin=null + @4:4..11 SET_VAR 'var y: kotlin.Int [var] declared in .test' type=kotlin.Unit origin=EQ + @4:8..11 BLOCK type=kotlin.Int origin=POSTFIX_DECR + @4:8..11 VAR IR_TEMPORARY_VARIABLE name: type:kotlin.Int [val] + @4:8..9 GET_VAR 'var x: kotlin.Int [var] declared in .test' type=kotlin.Int origin=null + @4:8..11 SET_VAR 'var x: kotlin.Int [var] declared in .test' type=kotlin.Unit origin=POSTFIX_DECR + @4:9..11 CALL 'public final fun dec (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + @4:8..11 GET_VAR 'val : kotlin.Int [val] declared in .test' type=kotlin.Int origin=null + @4:8..11 GET_VAR 'val : kotlin.Int [val] declared in .test' type=kotlin.Int origin=null diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/FirIrSourceRangesIdenticalChecker.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/FirIrSourceRangesIdenticalChecker.kt new file mode 100644 index 00000000000..9217746bdc5 --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/backend/handlers/FirIrSourceRangesIdenticalChecker.kt @@ -0,0 +1,44 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.backend.handlers + +import org.jetbrains.kotlin.test.WrappedException +import org.jetbrains.kotlin.test.directives.FirDiagnosticsDirectives +import org.jetbrains.kotlin.test.directives.model.DirectivesContainer +import org.jetbrains.kotlin.test.model.AfterAnalysisChecker +import org.jetbrains.kotlin.test.services.TestServices +import org.jetbrains.kotlin.test.services.moduleStructure +import org.jetbrains.kotlin.test.utils.FirIdenticalCheckerHelper +import org.jetbrains.kotlin.test.utils.withExtension +import java.io.File + +class FirIrSourceRangesIdenticalChecker(testServices: TestServices) : AfterAnalysisChecker(testServices) { + override val directiveContainers: List + get() = listOf(FirDiagnosticsDirectives) + + private val simpleChecker = object : FirIdenticalCheckerHelper(testServices) { + override fun getClassicFileToCompare(testDataFile: File): File? { + return testDataFile.withExtension(IrSourceRangesDumpHandler.DUMP_EXTENSION).takeIf { it.exists() } + } + + override fun getFirFileToCompare(testDataFile: File): File? { + return testDataFile.withExtension("fir.${IrSourceRangesDumpHandler.DUMP_EXTENSION}").takeIf { it.exists() } + } + } + + override fun check(failedAssertions: List) { + if (failedAssertions.isNotEmpty()) return + val testDataFile = testServices.moduleStructure.originalTestDataFiles.first() + if (FirDiagnosticsDirectives.FIR_IDENTICAL in testServices.moduleStructure.allDirectives) { + simpleChecker.deleteFirFile(testDataFile) + return + } + if (simpleChecker.firAndClassicContentsAreEquals(testDataFile)) { + simpleChecker.deleteFirFile(testDataFile) + simpleChecker.addDirectiveToClassicFileAndAssert(testDataFile) + } + } +} diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/AbstractFirJvmIrSourceRangesTest.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/AbstractFirJvmIrSourceRangesTest.kt new file mode 100644 index 00000000000..215575a8984 --- /dev/null +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/runners/ir/AbstractFirJvmIrSourceRangesTest.kt @@ -0,0 +1,50 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.test.runners.ir + +import org.jetbrains.kotlin.test.Constructor +import org.jetbrains.kotlin.test.FirParser +import org.jetbrains.kotlin.test.backend.handlers.FirIrSourceRangesIdenticalChecker +import org.jetbrains.kotlin.test.backend.ir.IrBackendInput +import org.jetbrains.kotlin.test.builders.TestConfigurationBuilder +import org.jetbrains.kotlin.test.directives.configureFirParser +import org.jetbrains.kotlin.test.frontend.fir.Fir2IrJvmResultsConverter +import org.jetbrains.kotlin.test.frontend.fir.FirFrontendFacade +import org.jetbrains.kotlin.test.frontend.fir.FirOutputArtifact +import org.jetbrains.kotlin.test.model.Frontend2BackendConverter +import org.jetbrains.kotlin.test.model.FrontendFacade +import org.jetbrains.kotlin.test.model.FrontendKind +import org.jetbrains.kotlin.test.model.FrontendKinds +import org.jetbrains.kotlin.test.runners.codegen.FirPsiCodegenTest + +abstract class AbstractFirJvmIrSourceRangesTest( + private val parser: FirParser, +) : AbstractJvmIrSourceRangesTest() { + + override val frontend: FrontendKind<*> + get() = FrontendKinds.FIR + + override val frontendFacade: Constructor> + get() = ::FirFrontendFacade + + override val converter: Constructor> + get() = ::Fir2IrJvmResultsConverter + + override fun configure(builder: TestConfigurationBuilder) { + super.configure(builder) + with(builder) { + configureFirParser(parser) + useAfterAnalysisCheckers( + ::FirIrSourceRangesIdenticalChecker, + ) + } + } +} + +open class AbstractFirLightTreeJvmIrSourceRangesTest : AbstractFirJvmIrSourceRangesTest(FirParser.LightTree) + +@FirPsiCodegenTest +open class AbstractFirPsiJvmIrSourceRangesTest : AbstractFirJvmIrSourceRangesTest(FirParser.Psi) diff --git a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt index cd225a76104..22f4725f082 100644 --- a/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt +++ b/compiler/tests-for-compiler-generator/tests/org/jetbrains/kotlin/test/generators/GenerateJUnit5CompilerTests.kt @@ -379,6 +379,14 @@ fun generateJUnit5CompilerTests(args: Array, mainClassName: String?) { model("ir/irText") } + testClass { + model("ir/sourceRanges") + } + + testClass { + model("ir/sourceRanges") + } + testClass { model("codegen/bytecodeText") }