diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObject.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObject.after.txt new file mode 100644 index 00000000000..1792b2279fe --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObject.after.txt @@ -0,0 +1,12 @@ +public final [ResolvedTo(BODY_RESOLVE)] fun function([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Int| { + ^function R|/i| +} + +public final [ResolvedTo(BODY_RESOLVE)] val property: R|kotlin/Int| = this@R|lowlevel/|.R|lowlevel/.function|(Int(1)) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=] get(): R|kotlin/Int| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObject.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObject.before.txt new file mode 100644 index 00000000000..1792b2279fe --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObject.before.txt @@ -0,0 +1,12 @@ +public final [ResolvedTo(BODY_RESOLVE)] fun function([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Int| { + ^function R|/i| +} + +public final [ResolvedTo(BODY_RESOLVE)] val property: R|kotlin/Int| = this@R|lowlevel/|.R|lowlevel/.function|(Int(1)) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=] get(): R|kotlin/Int| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObject.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObject.kt new file mode 100644 index 00000000000..a2d7223f26f --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObject.kt @@ -0,0 +1,6 @@ +package lowlevel + +val prop = object { + fun function(i: Int) = i + val property = function(1) +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObjectScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObjectScript.after.txt new file mode 100644 index 00000000000..1792b2279fe --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObjectScript.after.txt @@ -0,0 +1,12 @@ +public final [ResolvedTo(BODY_RESOLVE)] fun function([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Int| { + ^function R|/i| +} + +public final [ResolvedTo(BODY_RESOLVE)] val property: R|kotlin/Int| = this@R|lowlevel/|.R|lowlevel/.function|(Int(1)) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=] get(): R|kotlin/Int| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObjectScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObjectScript.before.txt new file mode 100644 index 00000000000..1792b2279fe --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObjectScript.before.txt @@ -0,0 +1,12 @@ +public final [ResolvedTo(BODY_RESOLVE)] fun function([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Int| { + ^function R|/i| +} + +public final [ResolvedTo(BODY_RESOLVE)] val property: R|kotlin/Int| = this@R|lowlevel/|.R|lowlevel/.function|(Int(1)) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=] get(): R|kotlin/Int| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObjectScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObjectScript.kts new file mode 100644 index 00000000000..a2d7223f26f --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObjectScript.kts @@ -0,0 +1,6 @@ +package lowlevel + +val prop = object { + fun function(i: Int) = i + val property = function(1) +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/class.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/class.after.txt new file mode 100644 index 00000000000..3c8a44e9e23 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/class.after.txt @@ -0,0 +1,12 @@ +public final [ResolvedTo(BODY_RESOLVE)] fun function([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Int| { + ^function R|/i| +} + +public final [ResolvedTo(BODY_RESOLVE)] val property: R|kotlin/Int| = this@R|lowlevel/TopLevelClass|.R|lowlevel/TopLevelClass.function|(Int(1)) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=TopLevelClass] get(): R|kotlin/Int| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/class.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/class.before.txt new file mode 100644 index 00000000000..e94c3139515 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/class.before.txt @@ -0,0 +1,10 @@ +public final [ResolvedTo(STATUS)] fun function([ResolvedTo(STATUS)] i: R|kotlin/Int|): { LAZY_BLOCK } + +public final [ResolvedTo(STATUS)] val property: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=TopLevelClass] get(): + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/class.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/class.kt new file mode 100644 index 00000000000..66e994e0270 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/class.kt @@ -0,0 +1,6 @@ +package lowlevel + +class TopLevelClass { + fun function(i: Int) = i + val property = function(1) +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/classDeclarationsScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/classDeclarationsScript.after.txt new file mode 100644 index 00000000000..3c8a44e9e23 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/classDeclarationsScript.after.txt @@ -0,0 +1,12 @@ +public final [ResolvedTo(BODY_RESOLVE)] fun function([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Int| { + ^function R|/i| +} + +public final [ResolvedTo(BODY_RESOLVE)] val property: R|kotlin/Int| = this@R|lowlevel/TopLevelClass|.R|lowlevel/TopLevelClass.function|(Int(1)) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=TopLevelClass] get(): R|kotlin/Int| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/classDeclarationsScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/classDeclarationsScript.before.txt new file mode 100644 index 00000000000..e94c3139515 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/classDeclarationsScript.before.txt @@ -0,0 +1,10 @@ +public final [ResolvedTo(STATUS)] fun function([ResolvedTo(STATUS)] i: R|kotlin/Int|): { LAZY_BLOCK } + +public final [ResolvedTo(STATUS)] val property: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=TopLevelClass] get(): + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/classDeclarationsScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/classDeclarationsScript.kts new file mode 100644 index 00000000000..66e994e0270 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/classDeclarationsScript.kts @@ -0,0 +1,6 @@ +package lowlevel + +class TopLevelClass { + fun function(i: Int) = i + val property = function(1) +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/classFromStatement.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/classFromStatement.after.txt new file mode 100644 index 00000000000..92dad9dc851 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/classFromStatement.after.txt @@ -0,0 +1,12 @@ +public final [ResolvedTo(BODY_RESOLVE)] fun function([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Int| { + ^function R|/i| +} + +public final [ResolvedTo(BODY_RESOLVE)] val property: R|kotlin/Int| = this@R|/MyClass|.R|/function|(Int(1)) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/classFromStatement.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/classFromStatement.before.txt new file mode 100644 index 00000000000..92dad9dc851 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/classFromStatement.before.txt @@ -0,0 +1,12 @@ +public final [ResolvedTo(BODY_RESOLVE)] fun function([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Int| { + ^function R|/i| +} + +public final [ResolvedTo(BODY_RESOLVE)] val property: R|kotlin/Int| = this@R|/MyClass|.R|/function|(Int(1)) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/classFromStatement.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/classFromStatement.kts new file mode 100644 index 00000000000..67d27b998f2 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/classFromStatement.kts @@ -0,0 +1,10 @@ +package lowlevel + +if (true) { + class MyClass { + fun function(i: Int) = i + val property = function(1) + } +} + +fun foo() {} \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObject.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObject.after.txt new file mode 100644 index 00000000000..223028520f9 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObject.after.txt @@ -0,0 +1,35 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /BaseInterface.anotherFunction), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(BODY_RESOLVE)] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| { + ^anotherFunction Boolean(true) +} + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](str = (String(property ), R|/constant|)) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var property: R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObject.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObject.before.txt new file mode 100644 index 00000000000..e58857af14d --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObject.before.txt @@ -0,0 +1,31 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /BaseInterface.anotherFunction), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] var property: R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObject.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObject.kt new file mode 100644 index 00000000000..097c27dc753 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObject.kt @@ -0,0 +1,27 @@ +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + lateinit var d: IntermediateInterface + val prop = object : IntermediateInterface by d { + override fun isSchemeFile(name: CharSequence) = name != "str" + } +} + +interface IntermediateInterface : BaseInterface { +} + +interface BaseInterface { + fun isSchemeFile(name: CharSequence = genericCall()) = true + fun anotherFunction(name: CharSequence = genericCall()) = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: Int + + var property: Int +} + +fun genericCall(): T = null!! diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectScript.after.txt new file mode 100644 index 00000000000..223028520f9 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectScript.after.txt @@ -0,0 +1,35 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /BaseInterface.anotherFunction), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(BODY_RESOLVE)] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| { + ^anotherFunction Boolean(true) +} + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](str = (String(property ), R|/constant|)) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var property: R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectScript.before.txt new file mode 100644 index 00000000000..e58857af14d --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectScript.before.txt @@ -0,0 +1,31 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /BaseInterface.anotherFunction), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] var property: R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectScript.kts new file mode 100644 index 00000000000..097c27dc753 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectScript.kts @@ -0,0 +1,27 @@ +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + lateinit var d: IntermediateInterface + val prop = object : IntermediateInterface by d { + override fun isSchemeFile(name: CharSequence) = name != "str" + } +} + +interface IntermediateInterface : BaseInterface { +} + +interface BaseInterface { + fun isSchemeFile(name: CharSequence = genericCall()) = true + fun anotherFunction(name: CharSequence = genericCall()) = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: Int + + var property: Int +} + +fun genericCall(): T = null!! diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.after.txt new file mode 100644 index 00000000000..5a33442fe43 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.after.txt @@ -0,0 +1,59 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(str = (String(object ), R|/constant|)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.isSchemeFile), SubstitutedOverrideOriginalKey=/IntermediateClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.isSchemeFile] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.anotherFunction), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /IntermediateClass.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(str = (String(object ), R|/constant|)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.anotherFunction), SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.anotherFunction] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| { + ^anotherFunction Boolean(true) +} + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirPropertySymbol /IntermediateClass.propertyWithAnnotations), DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(str = (String(object ), R|/constant|)) kotlin/Int}, baseSymbol=FirPropertySymbol /IntermediateClass.propertyWithAnnotations), SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(BODY_RESOLVE)] value: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|SCHEME| = R|/genericCall|() + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](str = (String(property ), R|/constant|)) value: R|SCHEME|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.property] var property: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var property: R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] set([ResolvedTo(BODY_RESOLVE)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.before.txt new file mode 100644 index 00000000000..faeed194143 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.before.txt @@ -0,0 +1,55 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(str = (String(object ), R|/constant|)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.isSchemeFile), SubstitutedOverrideOriginalKey=/IntermediateClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(LAZY_EXPRESSION) SCHEME | MUTABLE_SCHEME -> @R|Anno|(LAZY_EXPRESSION) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /BaseClass.isSchemeFile), SubstitutedOverrideOriginalKey=/BaseClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.anotherFunction), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /IntermediateClass.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(str = (String(object ), R|/constant|)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.anotherFunction), SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(LAZY_EXPRESSION) SCHEME | MUTABLE_SCHEME -> @R|Anno|(LAZY_EXPRESSION) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /BaseClass.anotherFunction), SubstitutedOverrideOriginalKey=/BaseClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirPropertySymbol /IntermediateClass.propertyWithAnnotations), DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(str = (String(object ), R|/constant|)) kotlin/Int}, baseSymbol=FirPropertySymbol /IntermediateClass.propertyWithAnnotations), SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(LAZY_EXPRESSION) SCHEME | MUTABLE_SCHEME -> @R|Anno|(LAZY_EXPRESSION) kotlin/Int}, baseSymbol=FirPropertySymbol /BaseClass.propertyWithAnnotations), SubstitutedOverrideOriginalKey=/BaseClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] var propertyWithAnnotations: = LAZY_EXPRESSION + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: ): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.property] var property: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + + + +public abstract [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.kt new file mode 100644 index 00000000000..fcfeefd40ee --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.kt @@ -0,0 +1,27 @@ +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + lateinit var d: IntermediateClass + val prop = object : IntermediateClass<@Anno("object $constant") Int> by d { + override fun isSchemeFile(name: CharSequence) = name != "str" + } +} + +interface IntermediateClass : BaseClass<@Anno("super $constant") SCHEME, @Anno("super $constant") Int> { +} + +interface BaseClass { + fun isSchemeFile(name: CharSequence = genericCall()) = true + fun anotherFunction(name: CharSequence = genericCall()) = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations = genericCall() + + var property: SCHEME +} + +fun genericCall(): T = null!! diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitutionScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitutionScript.after.txt new file mode 100644 index 00000000000..5a33442fe43 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitutionScript.after.txt @@ -0,0 +1,59 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(str = (String(object ), R|/constant|)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.isSchemeFile), SubstitutedOverrideOriginalKey=/IntermediateClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.isSchemeFile] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.anotherFunction), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /IntermediateClass.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(str = (String(object ), R|/constant|)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.anotherFunction), SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.anotherFunction] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| { + ^anotherFunction Boolean(true) +} + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirPropertySymbol /IntermediateClass.propertyWithAnnotations), DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(str = (String(object ), R|/constant|)) kotlin/Int}, baseSymbol=FirPropertySymbol /IntermediateClass.propertyWithAnnotations), SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(BODY_RESOLVE)] value: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|SCHEME| = R|/genericCall|() + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](str = (String(property ), R|/constant|)) value: R|SCHEME|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.property] var property: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var property: R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] set([ResolvedTo(BODY_RESOLVE)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitutionScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitutionScript.before.txt new file mode 100644 index 00000000000..faeed194143 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitutionScript.before.txt @@ -0,0 +1,55 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(str = (String(object ), R|/constant|)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.isSchemeFile), SubstitutedOverrideOriginalKey=/IntermediateClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(LAZY_EXPRESSION) SCHEME | MUTABLE_SCHEME -> @R|Anno|(LAZY_EXPRESSION) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /BaseClass.isSchemeFile), SubstitutedOverrideOriginalKey=/BaseClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.anotherFunction), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /IntermediateClass.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(str = (String(object ), R|/constant|)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.anotherFunction), SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(LAZY_EXPRESSION) SCHEME | MUTABLE_SCHEME -> @R|Anno|(LAZY_EXPRESSION) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /BaseClass.anotherFunction), SubstitutedOverrideOriginalKey=/BaseClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirPropertySymbol /IntermediateClass.propertyWithAnnotations), DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(str = (String(object ), R|/constant|)) kotlin/Int}, baseSymbol=FirPropertySymbol /IntermediateClass.propertyWithAnnotations), SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(LAZY_EXPRESSION) SCHEME | MUTABLE_SCHEME -> @R|Anno|(LAZY_EXPRESSION) kotlin/Int}, baseSymbol=FirPropertySymbol /BaseClass.propertyWithAnnotations), SubstitutedOverrideOriginalKey=/BaseClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] var propertyWithAnnotations: = LAZY_EXPRESSION + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: ): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.property] var property: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + + + +public abstract [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitutionScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitutionScript.kts new file mode 100644 index 00000000000..2970a802bb3 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitutionScript.kts @@ -0,0 +1,27 @@ +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + lateinit var d: IntermediateClass + val prop = object : IntermediateClass<@Anno("object $constant") Int> by d { + override fun isSchemeFile(name: CharSequence) = name != "str" + } +} + +interface IntermediateClass : BaseClass<@Anno("super $constant") SCHEME, @Anno("super $constant") Int> { +} + +interface BaseClass { + fun isSchemeFile(name: CharSequence = genericCall()) = true + fun anotherFunction(name: CharSequence = genericCall()) = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations = genericCall() + + var property: SCHEME +} + +fun genericCall(): T = null!! \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClass.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClass.after.txt new file mode 100644 index 00000000000..dbd62603d18 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClass.after.txt @@ -0,0 +1,35 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| { + ^anotherFunction Boolean(true) +} + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](str = (String(property ), R|/constant|)) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var property: R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClass.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClass.before.txt new file mode 100644 index 00000000000..a1473f87996 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClass.before.txt @@ -0,0 +1,29 @@ +public open override [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /BaseInterface.anotherFunction), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] var property: R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClass.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClass.kt new file mode 100644 index 00000000000..a11742dac63 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClass.kt @@ -0,0 +1,25 @@ +annotation class Anno(val str: String) +val constant = "const" + +lateinit var d: IntermediateInterface +class MyClass : IntermediateInterface by d { + override fun isSchemeFile(name: CharSequence) = name != "str" +} + +interface IntermediateInterface : BaseInterface { +} + +interface BaseInterface { + fun isSchemeFile(name: CharSequence = genericCall()) = true + fun anotherFunction(name: CharSequence = genericCall()) = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: Int + + var property: Int +} + +fun genericCall(): T = null!! diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassScript.after.txt new file mode 100644 index 00000000000..dbd62603d18 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassScript.after.txt @@ -0,0 +1,35 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence| = R|/genericCall|()): R|kotlin/Boolean| { + ^anotherFunction Boolean(true) +} + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](str = (String(property ), R|/constant|)) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var property: R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassScript.before.txt new file mode 100644 index 00000000000..a1473f87996 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassScript.before.txt @@ -0,0 +1,29 @@ +public open override [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /BaseInterface.anotherFunction), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] var property: R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassScript.kts new file mode 100644 index 00000000000..a11742dac63 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassScript.kts @@ -0,0 +1,25 @@ +annotation class Anno(val str: String) +val constant = "const" + +lateinit var d: IntermediateInterface +class MyClass : IntermediateInterface by d { + override fun isSchemeFile(name: CharSequence) = name != "str" +} + +interface IntermediateInterface : BaseInterface { +} + +interface BaseInterface { + fun isSchemeFile(name: CharSequence = genericCall()) = true + fun anotherFunction(name: CharSequence = genericCall()) = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: Int + + var property: Int +} + +fun genericCall(): T = null!! diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitution.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitution.before.txt new file mode 100644 index 00000000000..eae367385da --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitution.before.txt @@ -0,0 +1,53 @@ +public open override [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|((String(class ), constant#)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.isSchemeFile), SubstitutedOverrideOriginalKey=/IntermediateClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(LAZY_EXPRESSION) SCHEME | MUTABLE_SCHEME -> @R|Anno|(LAZY_EXPRESSION) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /BaseClass.isSchemeFile), SubstitutedOverrideOriginalKey=/BaseClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.anotherFunction), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /IntermediateClass.anotherFunction, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|((String(class ), constant#)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.anotherFunction), SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(LAZY_EXPRESSION) SCHEME | MUTABLE_SCHEME -> @R|Anno|(LAZY_EXPRESSION) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /BaseClass.anotherFunction), SubstitutedOverrideOriginalKey=/BaseClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirPropertySymbol /IntermediateClass.propertyWithAnnotations), DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.propertyWithAnnotations, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|((String(class ), constant#)) kotlin/Int}, baseSymbol=FirPropertySymbol /IntermediateClass.propertyWithAnnotations), SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(LAZY_EXPRESSION) SCHEME | MUTABLE_SCHEME -> @R|Anno|(LAZY_EXPRESSION) kotlin/Int}, baseSymbol=FirPropertySymbol /BaseClass.propertyWithAnnotations), SubstitutedOverrideOriginalKey=/BaseClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] var propertyWithAnnotations: = LAZY_EXPRESSION + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: ): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.property, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.property] var property: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + + + +public abstract [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitution.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitution.kt new file mode 100644 index 00000000000..03830e8e90b --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitution.kt @@ -0,0 +1,27 @@ +// IGNORE_FIR + +annotation class Anno(val str: String) +val constant = "const" + +lateinit var d: IntermediateClass +class MyClass : IntermediateClass<@Anno("class $constant") Int> by d { + override fun isSchemeFile(name: CharSequence) = name != "str" +} + +interface IntermediateClass : BaseClass<@Anno("super $constant") SCHEME, @Anno("super $constant") Int> { +} + +interface BaseClass { + fun isSchemeFile(name: CharSequence = genericCall()) = true + fun anotherFunction(name: CharSequence = genericCall()) = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations = genericCall() + + var property: SCHEME +} + +fun genericCall(): T = null!! diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitutionScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitutionScript.before.txt new file mode 100644 index 00000000000..eae367385da --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitutionScript.before.txt @@ -0,0 +1,53 @@ +public open override [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|((String(class ), constant#)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.isSchemeFile), SubstitutedOverrideOriginalKey=/IntermediateClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(LAZY_EXPRESSION) SCHEME | MUTABLE_SCHEME -> @R|Anno|(LAZY_EXPRESSION) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /BaseClass.isSchemeFile), SubstitutedOverrideOriginalKey=/BaseClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.anotherFunction), DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /IntermediateClass.anotherFunction, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|((String(class ), constant#)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /IntermediateClass.anotherFunction), SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(LAZY_EXPRESSION) SCHEME | MUTABLE_SCHEME -> @R|Anno|(LAZY_EXPRESSION) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol /BaseClass.anotherFunction), SubstitutedOverrideOriginalKey=/BaseClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|kotlin/CharSequence| = LAZY_EXPRESSION): { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirPropertySymbol /IntermediateClass.propertyWithAnnotations), DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.propertyWithAnnotations, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|((String(class ), constant#)) kotlin/Int}, baseSymbol=FirPropertySymbol /IntermediateClass.propertyWithAnnotations), SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|Anno|(LAZY_EXPRESSION) SCHEME | MUTABLE_SCHEME -> @R|Anno|(LAZY_EXPRESSION) kotlin/Int}, baseSymbol=FirPropertySymbol /BaseClass.propertyWithAnnotations), SubstitutedOverrideOriginalKey=/BaseClass.propertyWithAnnotations] var propertyWithAnnotations: + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] var propertyWithAnnotations: = LAZY_EXPRESSION + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: ): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.property, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.property] var property: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + + + +public abstract [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitutionScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitutionScript.kts new file mode 100644 index 00000000000..03830e8e90b --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitutionScript.kts @@ -0,0 +1,27 @@ +// IGNORE_FIR + +annotation class Anno(val str: String) +val constant = "const" + +lateinit var d: IntermediateClass +class MyClass : IntermediateClass<@Anno("class $constant") Int> by d { + override fun isSchemeFile(name: CharSequence) = name != "str" +} + +interface IntermediateClass : BaseClass<@Anno("super $constant") SCHEME, @Anno("super $constant") Int> { +} + +interface BaseClass { + fun isSchemeFile(name: CharSequence = genericCall()) = true + fun anotherFunction(name: CharSequence = genericCall()) = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations = genericCall() + + var property: SCHEME +} + +fun genericCall(): T = null!! diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObject.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObject.after.txt new file mode 100644 index 00000000000..a3a79ed0eea --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObject.after.txt @@ -0,0 +1,35 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^anotherFunction Boolean(true) +} + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](str = (String(property ), R|/constant|)) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var property: R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObject.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObject.before.txt new file mode 100644 index 00000000000..bb10b550c14 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObject.before.txt @@ -0,0 +1,31 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] var property: R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObject.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObject.kt new file mode 100644 index 00000000000..7e79c0b855c --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObject.kt @@ -0,0 +1,25 @@ +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + lateinit var d: IntermediateInterface + val prop = object : IntermediateInterface by d { + override fun isSchemeFile(name: CharSequence): Boolean = name != "str" + } +} + +interface IntermediateInterface : BaseInterface { +} + +interface BaseInterface { + fun isSchemeFile(name: CharSequence): Boolean = true + fun anotherFunction(name: CharSequence): Boolean = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: Int + + var property: Int +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectScript.after.txt new file mode 100644 index 00000000000..a3a79ed0eea --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectScript.after.txt @@ -0,0 +1,35 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^anotherFunction Boolean(true) +} + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](str = (String(property ), R|/constant|)) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var property: R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectScript.before.txt new file mode 100644 index 00000000000..bb10b550c14 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectScript.before.txt @@ -0,0 +1,31 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] var property: R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts new file mode 100644 index 00000000000..7e79c0b855c --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts @@ -0,0 +1,25 @@ +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + lateinit var d: IntermediateInterface + val prop = object : IntermediateInterface by d { + override fun isSchemeFile(name: CharSequence): Boolean = name != "str" + } +} + +interface IntermediateInterface : BaseInterface { +} + +interface BaseInterface { + fun isSchemeFile(name: CharSequence): Boolean = true + fun anotherFunction(name: CharSequence): Boolean = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: Int + + var property: Int +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.after.txt new file mode 100644 index 00000000000..9a9ab52c2ae --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.after.txt @@ -0,0 +1,59 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.isSchemeFile] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /IntermediateClass.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.anotherFunction] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| = R|/genericCall|()): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] name: R|SCHEME| = R|/genericCall|()): R|kotlin/Boolean| { + ^anotherFunction Boolean(true) +} + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(BODY_RESOLVE)] value: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](str = (String(property ), R|/constant|)) value: R|SCHEME|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.property] var property: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var property: R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] set([ResolvedTo(BODY_RESOLVE)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.before.txt new file mode 100644 index 00000000000..e0126e480f7 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.before.txt @@ -0,0 +1,55 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /IntermediateClass.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|SCHEME| = LAZY_EXPRESSION): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|Anno|(LAZY_EXPRESSION) SCHEME|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: R|SCHEME|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.property] var property: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + + + +public abstract [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.kt new file mode 100644 index 00000000000..dfd376609c3 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.kt @@ -0,0 +1,27 @@ +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + lateinit var d: IntermediateClass + val prop = object : IntermediateClass<@Anno("object $constant") Int> by d { + override fun isSchemeFile(name: CharSequence): Boolean = name != "str" + } +} + +interface IntermediateClass : BaseClass<@Anno("super $constant") SCHEME, @Anno("super $constant") Int> { +} + +interface BaseClass { + fun isSchemeFile(name: CharSequence): Boolean = true + fun anotherFunction(name: SCHEME = genericCall()): Boolean = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: SCHEME + + var property: SCHEME +} + +fun genericCall(): T = null!! diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitutionScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitutionScript.after.txt new file mode 100644 index 00000000000..9a9ab52c2ae --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitutionScript.after.txt @@ -0,0 +1,59 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.isSchemeFile] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /IntermediateClass.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.anotherFunction] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| = R|/genericCall|()): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] name: R|SCHEME| = R|/genericCall|()): R|kotlin/Boolean| { + ^anotherFunction Boolean(true) +} + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(BODY_RESOLVE)] value: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](str = (String(property ), R|/constant|)) value: R|SCHEME|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(str = (String(super ), R|/constant|)) kotlin/Int| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/BaseClass.property] var property: R|@R|Anno|(str = (String(super ), R|/constant|)) SCHEME| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var property: R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseClass] set([ResolvedTo(BODY_RESOLVE)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitutionScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitutionScript.before.txt new file mode 100644 index 00000000000..e0126e480f7 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitutionScript.before.txt @@ -0,0 +1,55 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /IntermediateClass.anotherFunction, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|SCHEME| = LAZY_EXPRESSION): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.propertyWithAnnotations, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] get(): R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=] set([ResolvedTo(STATUS)] value: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|Anno|(LAZY_EXPRESSION) SCHEME|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: R|SCHEME|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.property, containingClass=, delegateField=FirFieldSymbol /.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|(str = (String(object ), R|/constant|)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.property] var property: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + + + +public abstract [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitutionScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitutionScript.kts new file mode 100644 index 00000000000..dfd376609c3 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitutionScript.kts @@ -0,0 +1,27 @@ +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + lateinit var d: IntermediateClass + val prop = object : IntermediateClass<@Anno("object $constant") Int> by d { + override fun isSchemeFile(name: CharSequence): Boolean = name != "str" + } +} + +interface IntermediateClass : BaseClass<@Anno("super $constant") SCHEME, @Anno("super $constant") Int> { +} + +interface BaseClass { + fun isSchemeFile(name: CharSequence): Boolean = true + fun anotherFunction(name: SCHEME = genericCall()): Boolean = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: SCHEME + + var property: SCHEME +} + +fun genericCall(): T = null!! diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClass.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClass.after.txt new file mode 100644 index 00000000000..df7057fec8e --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClass.after.txt @@ -0,0 +1,35 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^anotherFunction Boolean(true) +} + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](str = (String(property ), R|/constant|)) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var property: R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClass.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClass.before.txt new file mode 100644 index 00000000000..a551d77caf5 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClass.before.txt @@ -0,0 +1,29 @@ +public open override [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] var property: R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClass.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClass.kt new file mode 100644 index 00000000000..5debfc915ed --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClass.kt @@ -0,0 +1,23 @@ +annotation class Anno(val str: String) +val constant = "const" + +lateinit var d: IntermediateInterface +class MyClass : IntermediateInterface by d { + override fun isSchemeFile(name: CharSequence): Boolean = name != "str" +} + +interface IntermediateInterface : BaseInterface { +} + +interface BaseInterface { + fun isSchemeFile(name: CharSequence): Boolean = true + fun anotherFunction(name: CharSequence): Boolean = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: Int + + var property: Int +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassScript.after.txt new file mode 100644 index 00000000000..df7057fec8e --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassScript.after.txt @@ -0,0 +1,35 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun anotherFunction([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^anotherFunction Boolean(true) +} + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](str = (String(property ), R|/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](str = (String(property ), R|/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|Anno|[Types](str = (String(property ), R|/constant|)) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var property: R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=BaseInterface] set([ResolvedTo(BODY_RESOLVE)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassScript.before.txt new file mode 100644 index 00000000000..a551d77caf5 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassScript.before.txt @@ -0,0 +1,29 @@ +public open override [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /BaseInterface.anotherFunction, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.propertyWithAnnotations, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var propertyWithAnnotations: R|kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: R|kotlin/Int|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /BaseInterface.property, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0] var property: R|kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] var property: R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] get(): R|kotlin/Int| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseInterface] set([ResolvedTo(STATUS)] value: R|kotlin/Int|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassScript.kts new file mode 100644 index 00000000000..5debfc915ed --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassScript.kts @@ -0,0 +1,23 @@ +annotation class Anno(val str: String) +val constant = "const" + +lateinit var d: IntermediateInterface +class MyClass : IntermediateInterface by d { + override fun isSchemeFile(name: CharSequence): Boolean = name != "str" +} + +interface IntermediateInterface : BaseInterface { +} + +interface BaseInterface { + fun isSchemeFile(name: CharSequence): Boolean = true + fun anotherFunction(name: CharSequence): Boolean = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: Int + + var property: Int +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitution.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitution.before.txt new file mode 100644 index 00000000000..726ecfcfe63 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitution.before.txt @@ -0,0 +1,53 @@ +public open override [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /IntermediateClass.anotherFunction, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|SCHEME| = LAZY_EXPRESSION): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.propertyWithAnnotations, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] get(): R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] set([ResolvedTo(STATUS)] value: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|Anno|(LAZY_EXPRESSION) SCHEME|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: R|SCHEME|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.property, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.property] var property: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + + + +public abstract [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitution.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitution.kt new file mode 100644 index 00000000000..426b9b2fd97 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitution.kt @@ -0,0 +1,27 @@ +// IGNORE_FIR + +annotation class Anno(val str: String) +val constant = "const" + +lateinit var d: IntermediateClass +class MyClass : IntermediateClass<@Anno("class $constant") Int> by d { + override fun isSchemeFile(name: CharSequence): Boolean = name != "str" +} + +interface IntermediateClass : BaseClass<@Anno("super $constant") SCHEME, @Anno("super $constant") Int> { +} + +interface BaseClass { + fun isSchemeFile(name: CharSequence): Boolean = true + fun anotherFunction(name: SCHEME = genericCall()): Boolean = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: SCHEME + + var property: SCHEME +} + +fun genericCall(): T = null!! diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitutionScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitutionScript.before.txt new file mode 100644 index 00000000000..726ecfcfe63 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitutionScript.before.txt @@ -0,0 +1,53 @@ +public open override [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirNamedFunctionSymbol /IntermediateClass.anotherFunction, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.anotherFunction] fun anotherFunction([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| = LAZY_EXPRESSION): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun anotherFunction([ResolvedTo(STATUS)] name: R|SCHEME| = LAZY_EXPRESSION): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.propertyWithAnnotations, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] get(): R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass] set([ResolvedTo(STATUS)] value: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.propertyWithAnnotations] var propertyWithAnnotations: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=IntermediateClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|Anno|(LAZY_EXPRESSION) SCHEME|): R|kotlin/Unit| + +@R|Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + @PROPERTY_SETTER:R|Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|Anno|[Types](LAZY_EXPRESSION) value: R|SCHEME|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [DelegatedWrapperDataKey=[wrapped=FirPropertySymbol /IntermediateClass.property, containingClass=MyClass, delegateField=FirFieldSymbol /MyClass.$$delegate_0, SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/IntermediateClass.property] var property: R|@R|Anno|((String(class ), constant#)) @R|Anno|(LAZY_EXPRESSION) kotlin/Int| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/BaseClass.property] var property: R|@R|Anno|(LAZY_EXPRESSION) SCHEME| + + + +public abstract [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=BaseClass] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitutionScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitutionScript.kts new file mode 100644 index 00000000000..426b9b2fd97 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitutionScript.kts @@ -0,0 +1,27 @@ +// IGNORE_FIR + +annotation class Anno(val str: String) +val constant = "const" + +lateinit var d: IntermediateClass +class MyClass : IntermediateClass<@Anno("class $constant") Int> by d { + override fun isSchemeFile(name: CharSequence): Boolean = name != "str" +} + +interface IntermediateClass : BaseClass<@Anno("super $constant") SCHEME, @Anno("super $constant") Int> { +} + +interface BaseClass { + fun isSchemeFile(name: CharSequence): Boolean = true + fun anotherFunction(name: SCHEME = genericCall()): Boolean = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: SCHEME + + var property: SCHEME +} + +fun genericCall(): T = null!! diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride.after.txt new file mode 100644 index 00000000000..26eea70946d --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride.after.txt @@ -0,0 +1,23 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Int|): R|kotlin/Unit| { +} + +public abstract [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Int|): R|kotlin/Unit| + +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| { +} + +public abstract [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride.before.txt new file mode 100644 index 00000000000..95174014c1c --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride.before.txt @@ -0,0 +1,21 @@ +public open override [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/Int|): R|kotlin/Unit| { LAZY_BLOCK } + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/Int|): R|kotlin/Unit| + +public open override [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/String|): R|kotlin/Unit| { LAZY_BLOCK } + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/String|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride.kt new file mode 100644 index 00000000000..b078ce3bd4b --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride.kt @@ -0,0 +1,19 @@ +class A : B { + override fun foo(x: Int) { + } + + override fun foo(x: String) { + } +} + +interface B: C, D + +interface C { + fun foo(x: Int) + fun foo(x: String) +} + +interface D { + fun foo(x: Int) + fun foo(x: String) +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2.after.txt new file mode 100644 index 00000000000..26eea70946d --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2.after.txt @@ -0,0 +1,23 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Int|): R|kotlin/Unit| { +} + +public abstract [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Int|): R|kotlin/Unit| + +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| { +} + +public abstract [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2.before.txt new file mode 100644 index 00000000000..95174014c1c --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2.before.txt @@ -0,0 +1,21 @@ +public open override [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/Int|): R|kotlin/Unit| { LAZY_BLOCK } + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/Int|): R|kotlin/Unit| + +public open override [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/String|): R|kotlin/Unit| { LAZY_BLOCK } + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/String|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2.kt new file mode 100644 index 00000000000..2c665621885 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2.kt @@ -0,0 +1,19 @@ +class A : B, C { + override fun foo(x: Int) { + } + + override fun foo(x: String) { + } +} + +interface B: C, D + +interface C { + fun foo(x: Int) + fun foo(x: String) +} + +interface D { + fun foo(x: Int) + fun foo(x: String) +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2Script.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2Script.after.txt new file mode 100644 index 00000000000..26eea70946d --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2Script.after.txt @@ -0,0 +1,23 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Int|): R|kotlin/Unit| { +} + +public abstract [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Int|): R|kotlin/Unit| + +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| { +} + +public abstract [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2Script.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2Script.before.txt new file mode 100644 index 00000000000..95174014c1c --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2Script.before.txt @@ -0,0 +1,21 @@ +public open override [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/Int|): R|kotlin/Unit| { LAZY_BLOCK } + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/Int|): R|kotlin/Unit| + +public open override [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/String|): R|kotlin/Unit| { LAZY_BLOCK } + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/String|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2Script.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2Script.kts new file mode 100644 index 00000000000..2c665621885 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2Script.kts @@ -0,0 +1,19 @@ +class A : B, C { + override fun foo(x: Int) { + } + + override fun foo(x: String) { + } +} + +interface B: C, D + +interface C { + fun foo(x: Int) + fun foo(x: String) +} + +interface D { + fun foo(x: Int) + fun foo(x: String) +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideScript.after.txt new file mode 100644 index 00000000000..26eea70946d --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideScript.after.txt @@ -0,0 +1,23 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Int|): R|kotlin/Unit| { +} + +public abstract [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/Int|): R|kotlin/Unit| + +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| { +} + +public abstract [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideScript.before.txt new file mode 100644 index 00000000000..95174014c1c --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideScript.before.txt @@ -0,0 +1,21 @@ +public open override [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/Int|): R|kotlin/Unit| { LAZY_BLOCK } + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/Int|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/Int|): R|kotlin/Unit| + +public open override [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/String|): R|kotlin/Unit| { LAZY_BLOCK } + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/String|): R|kotlin/Unit| + +public abstract [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|kotlin/String|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideScript.kts new file mode 100644 index 00000000000..b078ce3bd4b --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideScript.kts @@ -0,0 +1,19 @@ +class A : B { + override fun foo(x: Int) { + } + + override fun foo(x: String) { + } +} + +interface B: C, D + +interface C { + fun foo(x: Int) + fun foo(x: String) +} + +interface D { + fun foo(x: Int) + fun foo(x: String) +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObject.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObject.after.txt new file mode 100644 index 00000000000..761ef4813f9 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObject.after.txt @@ -0,0 +1,49 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| { + ^foo Q|kotlin/Unit| +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={T -> @R|second/Anno|(str = (String(object ), R|second/constant|)) kotlin/String}, baseSymbol=FirIntersectionOverrideFunctionSymbol second/B.foo), IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/B.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|@R|second/Anno|(str = (String(object ), R|second/constant|)) kotlin/String| = LAZY_EXPRESSION): + +public open [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|T| = R|second/genericCall|()): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|T| = R|second/genericCall|()): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|T| = R|second/genericCall|()): R|kotlin/Unit| { + ^foo Q|kotlin/Unit| +} + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/D.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|T| = R|second/genericCall#|<>()): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|F| = R|second/genericCall|()): R|kotlin/Unit| { + ^foo Q|kotlin/Unit| +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={T -> @R|second/Anno|(str = (String(object ), R|second/constant|)) kotlin/String}, baseSymbol=FirIntersectionOverridePropertySymbol second/B.bar), IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/B.bar] var bar: + + + +public open [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/C.bar] var bar: R|T| + + + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/C.bar] var bar: R|T| + + + +public open [ResolvedTo(BODY_RESOLVE)] var bar: R|T| = R|second/genericCall|() + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=C] get(): R|T| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=C] set([ResolvedTo(BODY_RESOLVE)] value: R|T|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/D.bar] var bar: + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(BODY_RESOLVE)] value: ): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public open [ResolvedTo(BODY_RESOLVE)] var bar: = R|second/genericCall#|<>() + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=D] get(): + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=D] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) value: ): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObject.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObject.before.txt new file mode 100644 index 00000000000..8416081777c --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObject.before.txt @@ -0,0 +1,45 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| { + ^foo Q|kotlin/Unit| +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={T -> @R|second/Anno|(str = (String(object ), R|second/constant|)) kotlin/String}, baseSymbol=FirIntersectionOverrideFunctionSymbol second/B.foo), IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/B.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|@R|second/Anno|(str = (String(object ), R|second/constant|)) kotlin/String| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol second/B.foo), IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|T| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={T -> T}, baseSymbol=FirNamedFunctionSymbol second/C.foo), SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|T| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|T| = LAZY_EXPRESSION): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={F -> T}, baseSymbol=FirNamedFunctionSymbol second/D.foo), SubstitutedOverrideOriginalKey=second/D.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|T| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|F| = LAZY_EXPRESSION): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={T -> @R|second/Anno|(str = (String(object ), R|second/constant|)) kotlin/String}, baseSymbol=FirIntersectionOverridePropertySymbol second/B.bar), IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/B.bar] var bar: + + + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirPropertySymbol second/B.bar), IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/C.bar] var bar: + + + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={T -> T}, baseSymbol=FirPropertySymbol second/C.bar), SubstitutedOverrideOriginalKey=second/C.bar] var bar: + + + +public open [ResolvedTo(STATUS)] var bar: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=C] get(): + public [ResolvedTo(STATUS)] [ContainingClassKey=C] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={F -> T}, baseSymbol=FirPropertySymbol second/D.bar), SubstitutedOverrideOriginalKey=second/D.bar] var bar: + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] var bar: = LAZY_EXPRESSION + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=D] get(): + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=D] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|second/Anno|[Types](LAZY_EXPRESSION) value: ): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObject.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObject.kt new file mode 100644 index 00000000000..a737d89fc75 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObject.kt @@ -0,0 +1,29 @@ +package second + +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + val prop = object : B<@Anno("object $constant") String> { + override fun foo(x: String) = Unit + } +} + +interface B: C, D + +interface C { + fun foo(x: T = genericCall()) = Unit + var bar = genericCall() +} + +interface D { + fun foo(x: F = genericCall()) = Unit + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var bar = genericCall() +} + +fun genericCall(): T = null!! \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObjectScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObjectScript.after.txt new file mode 100644 index 00000000000..761ef4813f9 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObjectScript.after.txt @@ -0,0 +1,49 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| { + ^foo Q|kotlin/Unit| +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={T -> @R|second/Anno|(str = (String(object ), R|second/constant|)) kotlin/String}, baseSymbol=FirIntersectionOverrideFunctionSymbol second/B.foo), IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/B.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|@R|second/Anno|(str = (String(object ), R|second/constant|)) kotlin/String| = LAZY_EXPRESSION): + +public open [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|T| = R|second/genericCall|()): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|T| = R|second/genericCall|()): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|T| = R|second/genericCall|()): R|kotlin/Unit| { + ^foo Q|kotlin/Unit| +} + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/D.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|T| = R|second/genericCall#|<>()): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|F| = R|second/genericCall|()): R|kotlin/Unit| { + ^foo Q|kotlin/Unit| +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={T -> @R|second/Anno|(str = (String(object ), R|second/constant|)) kotlin/String}, baseSymbol=FirIntersectionOverridePropertySymbol second/B.bar), IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/B.bar] var bar: + + + +public open [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/C.bar] var bar: R|T| + + + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/C.bar] var bar: R|T| + + + +public open [ResolvedTo(BODY_RESOLVE)] var bar: R|T| = R|second/genericCall|() + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=C] get(): R|T| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=C] set([ResolvedTo(BODY_RESOLVE)] value: R|T|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/D.bar] var bar: + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(BODY_RESOLVE)] value: ): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public open [ResolvedTo(BODY_RESOLVE)] var bar: = R|second/genericCall#|<>() + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=D] get(): + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=D] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) value: ): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObjectScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObjectScript.before.txt new file mode 100644 index 00000000000..8416081777c --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObjectScript.before.txt @@ -0,0 +1,45 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| { + ^foo Q|kotlin/Unit| +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={T -> @R|second/Anno|(str = (String(object ), R|second/constant|)) kotlin/String}, baseSymbol=FirIntersectionOverrideFunctionSymbol second/B.foo), IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/B.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|@R|second/Anno|(str = (String(object ), R|second/constant|)) kotlin/String| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirNamedFunctionSymbol second/B.foo), IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|T| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={T -> T}, baseSymbol=FirNamedFunctionSymbol second/C.foo), SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|T| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|T| = LAZY_EXPRESSION): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={F -> T}, baseSymbol=FirNamedFunctionSymbol second/D.foo), SubstitutedOverrideOriginalKey=second/D.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|T| = LAZY_EXPRESSION): + +public open [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|F| = LAZY_EXPRESSION): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={T -> @R|second/Anno|(str = (String(object ), R|second/constant|)) kotlin/String}, baseSymbol=FirIntersectionOverridePropertySymbol second/B.bar), IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/B.bar] var bar: + + + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor=Empty, baseSymbol=FirPropertySymbol second/B.bar), IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/C.bar] var bar: + + + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={T -> T}, baseSymbol=FirPropertySymbol second/C.bar), SubstitutedOverrideOriginalKey=second/C.bar] var bar: + + + +public open [ResolvedTo(STATUS)] var bar: = LAZY_EXPRESSION + public [ResolvedTo(STATUS)] [ContainingClassKey=C] get(): + public [ResolvedTo(STATUS)] [ContainingClassKey=C] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={F -> T}, baseSymbol=FirPropertySymbol second/D.bar), SubstitutedOverrideOriginalKey=second/D.bar] var bar: + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] get(): + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: ): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] var bar: = LAZY_EXPRESSION + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=D] get(): + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=D] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|second/Anno|[Types](LAZY_EXPRESSION) value: ): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObjectScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObjectScript.kts new file mode 100644 index 00000000000..a737d89fc75 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObjectScript.kts @@ -0,0 +1,29 @@ +package second + +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + val prop = object : B<@Anno("object $constant") String> { + override fun foo(x: String) = Unit + } +} + +interface B: C, D + +interface C { + fun foo(x: T = genericCall()) = Unit + var bar = genericCall() +} + +interface D { + fun foo(x: F = genericCall()) = Unit + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var bar = genericCall() +} + +fun genericCall(): T = null!! \ No newline at end of file diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.after.txt new file mode 100644 index 00000000000..6b01f930cbc --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.after.txt @@ -0,0 +1,47 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| { + ^foo Q|kotlin/Unit| +} + +public open [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/B.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|@R|second/Anno|(str = (String(super ), R|second/constant|)) kotlin/String|): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|T|): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|T|): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|T|): R|kotlin/Unit| { +} + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/D.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|T|): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|F|): R|kotlin/Unit| { +} + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/B.bar] var bar: R|@R|second/Anno|(str = (String(super ), R|second/constant|)) kotlin/String| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/C.bar] var bar: R|T| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/C.bar] var bar: R|T| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var bar: R|T| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=C] get(): R|T| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=C] set([ResolvedTo(BODY_RESOLVE)] value: R|T|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/D.bar] var bar: R|T| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] get(): R|T| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(BODY_RESOLVE)] value: R|T|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] var bar: R|F| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=D] get(): R|F| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=D] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) value: R|F|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.before.txt new file mode 100644 index 00000000000..84870b268c6 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.before.txt @@ -0,0 +1,45 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| { + ^foo Q|kotlin/Unit| +} + +public open [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/B.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|@R|second/Anno|(str = (String(super ), R|second/constant|)) kotlin/String|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|T|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|T|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|T|): R|kotlin/Unit| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/D.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|T|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|F|): R|kotlin/Unit| { LAZY_BLOCK } + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/B.bar] var bar: R|@R|second/Anno|(str = (String(super ), R|second/constant|)) kotlin/String| + + + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/C.bar] var bar: R|T| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/C.bar] var bar: R|T| + + + +public abstract [ResolvedTo(STATUS)] var bar: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=C] get(): R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=C] set([ResolvedTo(STATUS)] value: R|T|): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/D.bar] var bar: R|T| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] get(): R|T| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|T|): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var bar: R|F| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=D] get(): R|F| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=D] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|second/Anno|[Types](LAZY_EXPRESSION) value: R|F|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.kt new file mode 100644 index 00000000000..16c907ae143 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.kt @@ -0,0 +1,27 @@ +package second + +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + val prop = object : B<@Anno("super $constant") String> { + override fun foo(x: String): Unit = Unit + } +} + +interface B: C, D + +interface C { + fun foo(x: T) {} + var bar: T +} + +interface D { + fun foo(x: F) {} + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var bar: F +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.after.txt new file mode 100644 index 00000000000..6b01f930cbc --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.after.txt @@ -0,0 +1,47 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| { + ^foo Q|kotlin/Unit| +} + +public open [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/B.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|@R|second/Anno|(str = (String(super ), R|second/constant|)) kotlin/String|): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|T|): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|T|): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|T|): R|kotlin/Unit| { +} + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/D.foo] fun foo([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/x] x: R|T|): R|kotlin/Unit| + +public open [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|F|): R|kotlin/Unit| { +} + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/B.bar] var bar: R|@R|second/Anno|(str = (String(super ), R|second/constant|)) kotlin/String| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] [IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/C.bar] var bar: R|T| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/C.bar] var bar: R|T| + + + +public abstract [ResolvedTo(BODY_RESOLVE)] var bar: R|T| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=C] get(): R|T| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=C] set([ResolvedTo(BODY_RESOLVE)] value: R|T|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/D.bar] var bar: R|T| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] get(): R|T| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(BODY_RESOLVE)] value: R|T|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public abstract [ResolvedTo(BODY_RESOLVE)] var bar: R|F| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=D] get(): R|F| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=D] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) value: R|F|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.before.txt new file mode 100644 index 00000000000..84870b268c6 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.before.txt @@ -0,0 +1,45 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun foo([ResolvedTo(BODY_RESOLVE)] x: R|kotlin/String|): R|kotlin/Unit| { + ^foo Q|kotlin/Unit| +} + +public open [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/B.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|@R|second/Anno|(str = (String(super ), R|second/constant|)) kotlin/String|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=second/B.foo, SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|T|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/C.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|T|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|T|): R|kotlin/Unit| { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/D.foo] fun foo([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/x] x: R|T|): R|kotlin/Unit| + +public open [ResolvedTo(STATUS)] fun foo([ResolvedTo(STATUS)] x: R|F|): R|kotlin/Unit| { LAZY_BLOCK } + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/B.bar] var bar: R|@R|second/Anno|(str = (String(super ), R|second/constant|)) kotlin/String| + + + +public abstract [ResolvedTo(STATUS)] [IntersectionOverrideOriginalKey=second/B.bar, SubstitutedOverrideOriginalKey=second/C.bar] var bar: R|T| + + + +public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/C.bar] var bar: R|T| + + + +public abstract [ResolvedTo(STATUS)] var bar: R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=C] get(): R|T| + public [ResolvedTo(STATUS)] [ContainingClassKey=C] set([ResolvedTo(STATUS)] value: R|T|): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/D.bar] var bar: R|T| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] get(): R|T| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=B, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|T|): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public abstract [ResolvedTo(STATUS)] var bar: R|F| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=D] get(): R|F| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=D] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|second/Anno|[Types](LAZY_EXPRESSION) value: R|F|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts new file mode 100644 index 00000000000..16c907ae143 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts @@ -0,0 +1,27 @@ +package second + +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + val prop = object : B<@Anno("super $constant") String> { + override fun foo(x: String): Unit = Unit + } +} + +interface B: C, D + +interface C { + fun foo(x: T) {} + var bar: T +} + +interface D { + fun foo(x: F) {} + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var bar: F +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/localClass.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/localClass.after.txt new file mode 100644 index 00000000000..92dad9dc851 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/localClass.after.txt @@ -0,0 +1,12 @@ +public final [ResolvedTo(BODY_RESOLVE)] fun function([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Int| { + ^function R|/i| +} + +public final [ResolvedTo(BODY_RESOLVE)] val property: R|kotlin/Int| = this@R|/MyClass|.R|/function|(Int(1)) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/localClass.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/localClass.before.txt new file mode 100644 index 00000000000..92dad9dc851 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/localClass.before.txt @@ -0,0 +1,12 @@ +public final [ResolvedTo(BODY_RESOLVE)] fun function([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Int| { + ^function R|/i| +} + +public final [ResolvedTo(BODY_RESOLVE)] val property: R|kotlin/Int| = this@R|/MyClass|.R|/function|(Int(1)) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/localClass.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/localClass.kt new file mode 100644 index 00000000000..bb645a1109b --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/localClass.kt @@ -0,0 +1,8 @@ +package lowlevel + +fun foo() { + class MyClass { + fun function(i: Int) = i + val property = function(1) + } +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/localClassScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/localClassScript.after.txt new file mode 100644 index 00000000000..92dad9dc851 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/localClassScript.after.txt @@ -0,0 +1,12 @@ +public final [ResolvedTo(BODY_RESOLVE)] fun function([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Int| { + ^function R|/i| +} + +public final [ResolvedTo(BODY_RESOLVE)] val property: R|kotlin/Int| = this@R|/MyClass|.R|/function|(Int(1)) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/localClassScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/localClassScript.before.txt new file mode 100644 index 00000000000..92dad9dc851 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/localClassScript.before.txt @@ -0,0 +1,12 @@ +public final [ResolvedTo(BODY_RESOLVE)] fun function([ResolvedTo(BODY_RESOLVE)] i: R|kotlin/Int|): R|kotlin/Int| { + ^function R|/i| +} + +public final [ResolvedTo(BODY_RESOLVE)] val property: R|kotlin/Int| = this@R|/MyClass|.R|/function|(Int(1)) + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass] get(): R|kotlin/Int| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/localClassScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/localClassScript.kts new file mode 100644 index 00000000000..bb645a1109b --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/localClassScript.kts @@ -0,0 +1,8 @@ +package lowlevel + +fun foo() { + class MyClass { + fun function(i: Int) = i + val property = function(1) + } +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObject.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObject.after.txt new file mode 100644 index 00000000000..d67abeed1be --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObject.after.txt @@ -0,0 +1,31 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int | MUTABLE_SCHEME -> @R|second/Anno|(str = (String(super2 ), R|second/constant|)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol second/LazySchemeProcessor.isSchemeFile), SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + + + +public final [ResolvedTo(BODY_RESOLVE)] var property: R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObject.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObject.before.txt new file mode 100644 index 00000000000..d7dc4cd1c65 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObject.before.txt @@ -0,0 +1,29 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int | MUTABLE_SCHEME -> @R|second/Anno|(str = (String(super2 ), R|second/constant|)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol second/LazySchemeProcessor.isSchemeFile), SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): { LAZY_BLOCK } + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|second/Anno|[Types](LAZY_EXPRESSION) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + + + +public final [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObject.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObject.kt new file mode 100644 index 00000000000..755ceaf8517 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObject.kt @@ -0,0 +1,22 @@ +package second + +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + val prop = object : LazySchemeProcessor<@Anno("super1 $constant") Int, @Anno("super2 $constant") Int>() { + override fun isSchemeFile(name: CharSequence) = name != "str" + } +} + +abstract class LazySchemeProcessor { + open fun isSchemeFile(name: CharSequence) = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: SCHEME + + var property: SCHEME +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObjectScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObjectScript.after.txt new file mode 100644 index 00000000000..d67abeed1be --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObjectScript.after.txt @@ -0,0 +1,31 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int | MUTABLE_SCHEME -> @R|second/Anno|(str = (String(super2 ), R|second/constant|)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol second/LazySchemeProcessor.isSchemeFile), SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + + + +public final [ResolvedTo(BODY_RESOLVE)] var property: R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObjectScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObjectScript.before.txt new file mode 100644 index 00000000000..d7dc4cd1c65 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObjectScript.before.txt @@ -0,0 +1,29 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int | MUTABLE_SCHEME -> @R|second/Anno|(str = (String(super2 ), R|second/constant|)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol second/LazySchemeProcessor.isSchemeFile), SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): { LAZY_BLOCK } + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|second/Anno|[Types](LAZY_EXPRESSION) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + + + +public final [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObjectScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObjectScript.kts new file mode 100644 index 00000000000..755ceaf8517 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObjectScript.kts @@ -0,0 +1,22 @@ +package second + +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + val prop = object : LazySchemeProcessor<@Anno("super1 $constant") Int, @Anno("super2 $constant") Int>() { + override fun isSchemeFile(name: CharSequence) = name != "str" + } +} + +abstract class LazySchemeProcessor { + open fun isSchemeFile(name: CharSequence) = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: SCHEME + + var property: SCHEME +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClass.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClass.after.txt new file mode 100644 index 00000000000..9ca5bbca526 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClass.after.txt @@ -0,0 +1,31 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(BODY_RESOLVE)] value: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + + + +public final [ResolvedTo(BODY_RESOLVE)] var property: R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClass.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClass.before.txt new file mode 100644 index 00000000000..269af1073f8 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClass.before.txt @@ -0,0 +1,27 @@ +public open override [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|second/Anno|((String(super1 ), constant#)) kotlin/Int | MUTABLE_SCHEME -> @R|second/Anno|((String(super2 ), constant#)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol second/LazySchemeProcessor.isSchemeFile), SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): { LAZY_BLOCK } + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|second/Anno|[Types](LAZY_EXPRESSION) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int| + + + +public final [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClass.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClass.kt new file mode 100644 index 00000000000..ca29ffa4136 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClass.kt @@ -0,0 +1,20 @@ +package second + +annotation class Anno(val str: String) +val constant = "const" + +class MyClass : LazySchemeProcessor<@Anno("super1 $constant") Int, @Anno("super2 $constant") Int>() { + override fun isSchemeFile(name: CharSequence) = name != "str" +} + +abstract class LazySchemeProcessor { + open fun isSchemeFile(name: CharSequence) = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: SCHEME + + var property: SCHEME +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClassScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClassScript.after.txt new file mode 100644 index 00000000000..9ca5bbca526 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClassScript.after.txt @@ -0,0 +1,31 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(BODY_RESOLVE)] value: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + + + +public final [ResolvedTo(BODY_RESOLVE)] var property: R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClassScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClassScript.before.txt new file mode 100644 index 00000000000..269af1073f8 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClassScript.before.txt @@ -0,0 +1,27 @@ +public open override [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): { LAZY_BLOCK } + +public open [ResolvedTo(STATUS)] [CallableCopySubstitutionKey=CallableCopySubstitution(substitutor={SCHEME -> @R|second/Anno|((String(super1 ), constant#)) kotlin/Int | MUTABLE_SCHEME -> @R|second/Anno|((String(super2 ), constant#)) kotlin/Int}, baseSymbol=FirNamedFunctionSymbol second/LazySchemeProcessor.isSchemeFile), SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): { LAZY_BLOCK } + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|second/Anno|[Types](LAZY_EXPRESSION) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int| + + + +public final [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClassScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClassScript.kts new file mode 100644 index 00000000000..ca29ffa4136 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClassScript.kts @@ -0,0 +1,20 @@ +package second + +annotation class Anno(val str: String) +val constant = "const" + +class MyClass : LazySchemeProcessor<@Anno("super1 $constant") Int, @Anno("super2 $constant") Int>() { + override fun isSchemeFile(name: CharSequence) = name != "str" +} + +abstract class LazySchemeProcessor { + open fun isSchemeFile(name: CharSequence) = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: SCHEME + + var property: SCHEME +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.after.txt new file mode 100644 index 00000000000..3d13d5bf12f --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.after.txt @@ -0,0 +1,31 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + + + +public final [ResolvedTo(BODY_RESOLVE)] var property: R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.before.txt new file mode 100644 index 00000000000..4f39a9ce168 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.before.txt @@ -0,0 +1,29 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|second/Anno|[Types](LAZY_EXPRESSION) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + + + +public final [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.kt new file mode 100644 index 00000000000..3085e2a75f8 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.kt @@ -0,0 +1,22 @@ +package second + +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + val prop = object : LazySchemeProcessor<@Anno("super1 $constant") Int, @Anno("super2 $constant") Int>() { + override fun isSchemeFile(name: CharSequence): Boolean = name != "str" + } +} + +abstract class LazySchemeProcessor { + open fun isSchemeFile(name: CharSequence): Boolean = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: SCHEME + + var property: SCHEME +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.after.txt new file mode 100644 index 00000000000..3d13d5bf12f --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.after.txt @@ -0,0 +1,31 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + + + +public final [ResolvedTo(BODY_RESOLVE)] var property: R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.before.txt new file mode 100644 index 00000000000..4f39a9ce168 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.before.txt @@ -0,0 +1,29 @@ +public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|second/Anno|[Types](LAZY_EXPRESSION) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + + + +public final [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts new file mode 100644 index 00000000000..3085e2a75f8 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts @@ -0,0 +1,22 @@ +package second + +annotation class Anno(val str: String) +val constant = "const" + +class MyClass { + val prop = object : LazySchemeProcessor<@Anno("super1 $constant") Int, @Anno("super2 $constant") Int>() { + override fun isSchemeFile(name: CharSequence): Boolean = name != "str" + } +} + +abstract class LazySchemeProcessor { + open fun isSchemeFile(name: CharSequence): Boolean = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: SCHEME + + var property: SCHEME +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClass.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClass.after.txt new file mode 100644 index 00000000000..815e1c8d225 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClass.after.txt @@ -0,0 +1,31 @@ +@R|second/Anno|[Types](str = (String(function ), R|second/constant|)) public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +@R|second/Anno|[Types](str = (String(base function ), R|second/constant|)) public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +@R|second/Anno|[Types](str = (String(base function ), R|second/constant|)) public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(BODY_RESOLVE)] value: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + + + +public final [ResolvedTo(BODY_RESOLVE)] var property: R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClass.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClass.before.txt new file mode 100644 index 00000000000..bca4675eaf0 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClass.before.txt @@ -0,0 +1,27 @@ +@R|second/Anno|[Types](LAZY_EXPRESSION) public open override [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|second/Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|second/Anno|[Types](LAZY_EXPRESSION) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int| + + + +public final [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClass.kt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClass.kt new file mode 100644 index 00000000000..018d14809a6 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClass.kt @@ -0,0 +1,22 @@ +package second + +annotation class Anno(val str: String) +val constant = "const" + +class MyClass : LazySchemeProcessor<@Anno("super1 $constant") Int, @Anno("super2 $constant") Int>() { + @Anno("function $constant") + override fun isSchemeFile(name: CharSequence): Boolean = name != "str" +} + +abstract class LazySchemeProcessor { + @Anno("base function $constant") + open fun isSchemeFile(name: CharSequence): Boolean = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: SCHEME + + var property: SCHEME +} diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClassScript.after.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClassScript.after.txt new file mode 100644 index 00000000000..815e1c8d225 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClassScript.after.txt @@ -0,0 +1,31 @@ +@R|second/Anno|[Types](str = (String(function ), R|second/constant|)) public open override [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile !=(R|/name|, String(str)) +} + +@R|second/Anno|[Types](str = (String(base function ), R|second/constant|)) public open [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +@R|second/Anno|[Types](str = (String(base function ), R|second/constant|)) public open [ResolvedTo(BODY_RESOLVE)] fun isSchemeFile([ResolvedTo(BODY_RESOLVE)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { + ^isSchemeFile Boolean(true) +} + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(BODY_RESOLVE)] value: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public final [ResolvedTo(BODY_RESOLVE)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] @SETTER_PARAMETER:R|second/Anno|[Types](str = (String(property ), R|second/constant|)) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(BODY_RESOLVE)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|(str = (String(super1 ), R|second/constant|)) kotlin/Int| + + + +public final [ResolvedTo(BODY_RESOLVE)] var property: R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(BODY_RESOLVE)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(BODY_RESOLVE)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClassScript.before.txt b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClassScript.before.txt new file mode 100644 index 00000000000..bca4675eaf0 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClassScript.before.txt @@ -0,0 +1,27 @@ +@R|second/Anno|[Types](LAZY_EXPRESSION) public open override [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|second/Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.isSchemeFile] fun isSchemeFile([ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=/name] name: R|kotlin/CharSequence|): R|kotlin/Boolean| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public open [ResolvedTo(STATUS)] fun isSchemeFile([ResolvedTo(STATUS)] name: R|kotlin/CharSequence|): R|kotlin/Boolean| { LAZY_BLOCK } + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.propertyWithAnnotations] var propertyWithAnnotations: R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] get(): R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=MyClass, SubstitutedOverrideOriginalKey=special/accessor] set([ResolvedTo(STATUS)] value: R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int|): R|kotlin/Unit| + +@R|second/Anno|[Types](LAZY_EXPRESSION) public final [ResolvedTo(STATUS)] var propertyWithAnnotations: R|SCHEME| + @PROPERTY_GETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + @PROPERTY_SETTER:R|second/Anno|[Types](LAZY_EXPRESSION) public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] @SETTER_PARAMETER:R|second/Anno|[Types](LAZY_EXPRESSION) value: R|SCHEME|): R|kotlin/Unit| + +public final [ResolvedTo(STATUS)] [SubstitutedOverrideOriginalKey=second/LazySchemeProcessor.property] var property: R|@R|second/Anno|((String(super1 ), constant#)) kotlin/Int| + + + +public final [ResolvedTo(STATUS)] var property: R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] get(): R|SCHEME| + public [ResolvedTo(STATUS)] [ContainingClassKey=LazySchemeProcessor] set([ResolvedTo(STATUS)] value: R|SCHEME|): R|kotlin/Unit| + +public open operator [ResolvedTo(BODY_RESOLVE)] fun equals([ResolvedTo(BODY_RESOLVE)] other: R|kotlin/Any?|): R|kotlin/Boolean| + +public open [ResolvedTo(BODY_RESOLVE)] fun hashCode(): R|kotlin/Int| + +public open [ResolvedTo(BODY_RESOLVE)] fun toString(): R|kotlin/String| diff --git a/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClassScript.kts b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClassScript.kts new file mode 100644 index 00000000000..018d14809a6 --- /dev/null +++ b/analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClassScript.kts @@ -0,0 +1,22 @@ +package second + +annotation class Anno(val str: String) +val constant = "const" + +class MyClass : LazySchemeProcessor<@Anno("super1 $constant") Int, @Anno("super2 $constant") Int>() { + @Anno("function $constant") + override fun isSchemeFile(name: CharSequence): Boolean = name != "str" +} + +abstract class LazySchemeProcessor { + @Anno("base function $constant") + open fun isSchemeFile(name: CharSequence): Boolean = true + + @Anno("property $constant") + @get:Anno("property $constant") + @set:Anno("property $constant") + @setparam:Anno("property $constant") + var propertyWithAnnotations: SCHEME + + var property: SCHEME +} diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/resolve/AbstractLazyDeclarationResolveScopeBasedTest.kt b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/resolve/AbstractLazyDeclarationResolveScopeBasedTest.kt new file mode 100644 index 00000000000..43aeb0c9c1c --- /dev/null +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/resolve/AbstractLazyDeclarationResolveScopeBasedTest.kt @@ -0,0 +1,105 @@ +/* + * 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.analysis.low.level.api.fir.resolve + +import org.jetbrains.kotlin.analysis.low.level.api.fir.api.LLFirResolveSession +import org.jetbrains.kotlin.analysis.low.level.api.fir.api.resolveToFirSymbolOfType +import org.jetbrains.kotlin.analysis.low.level.api.fir.lazyResolveRenderer +import org.jetbrains.kotlin.analysis.low.level.api.fir.resolveWithClearCaches +import org.jetbrains.kotlin.analysis.low.level.api.fir.test.base.AbstractLowLevelApiLastModuleFirstFileTest +import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirOutOfContentRootTestConfigurator +import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirScriptTestConfigurator +import org.jetbrains.kotlin.analysis.low.level.api.fir.test.configurators.AnalysisApiFirSourceTestConfigurator +import org.jetbrains.kotlin.analysis.test.framework.services.expressionMarkerProvider +import org.jetbrains.kotlin.fir.declarations.FirResolvePhase +import org.jetbrains.kotlin.fir.scopes.ProcessorAction +import org.jetbrains.kotlin.fir.scopes.processAllCallables +import org.jetbrains.kotlin.fir.scopes.processAllOverriddenCallables +import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope +import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol +import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase +import org.jetbrains.kotlin.psi.KtClassOrObject +import org.jetbrains.kotlin.psi.KtFile +import org.jetbrains.kotlin.test.services.TestModuleStructure +import org.jetbrains.kotlin.test.services.TestServices +import org.jetbrains.kotlin.test.services.assertions + +/** + * This test exists to check lazy resolution for fake overrides + */ +abstract class AbstractLazyDeclarationResolveScopeBasedTest : AbstractLowLevelApiLastModuleFirstFileTest() { + override fun doTestByFileStructure(ktFile: KtFile, moduleStructure: TestModuleStructure, testServices: TestServices) { + val classOrObject = testServices.expressionMarkerProvider.getElementOfTypeAtCaret(ktFile) + resolveWithClearCaches(classOrObject) { session -> + val classSymbol = classOrObject.resolveToFirSymbolOfType>(session) + val symbols = collectAllCallableDeclarations(classSymbol, session) + val dumpBefore = dumpSymbols(symbols) + testServices.assertions.assertEqualsToTestDataFileSibling(dumpBefore, extension = "before.txt") + for (callableSymbol in symbols) { + callableSymbol.lazyResolveToPhase(FirResolvePhase.BODY_RESOLVE) + } + + val dumpAfter = dumpSymbols(symbols) + testServices.assertions.assertEqualsToTestDataFileSibling(dumpAfter, extension = "after.txt") + } + } +} + +private fun collectAllCallableDeclarations(classSymbol: FirClassSymbol<*>, session: LLFirResolveSession): Collection> { + val baseScope = classSymbol.unsubstitutedScope( + session.useSiteFirSession, + session.getScopeSessionFor(session.useSiteFirSession), + false, + FirResolvePhase.STATUS, + ) + + return buildSet { + baseScope.processAllCallables { callable -> + add(callable) + baseScope.processAllOverriddenCallables( + callable, + processor = { + add(it) + ProcessorAction.NEXT + }, + processDirectOverriddenCallablesWithBaseScope = { declaration, processor -> + if (declaration is FirPropertySymbol) { + processDirectOverriddenPropertiesWithBaseScope(declaration, processor) + } else { + declaration as FirNamedFunctionSymbol + processDirectOverriddenFunctionsWithBaseScope(declaration, processor) + } + } + ) + } + } +} + +private fun dumpSymbols(symbols: Collection>): String { + val builder = StringBuilder() + val renderer = lazyResolveRenderer(builder) + for (callableSymbol in symbols) { + if (builder.isNotEmpty()) builder.appendLine() + renderer.renderElementAsString(callableSymbol.fir) + } + + return builder.toString() +} + +abstract class AbstractSourceLazyDeclarationResolveScopeBasedTest : AbstractLazyDeclarationResolveScopeBasedTest() { + override val configurator = AnalysisApiFirSourceTestConfigurator(analyseInDependentSession = false) +} + +abstract class AbstractOutOfContentRootLazyDeclarationResolveScopeBasedTest : AbstractLazyDeclarationResolveScopeBasedTest() { + override val configurator get() = AnalysisApiFirOutOfContentRootTestConfigurator +} + +abstract class AbstractScriptLazyDeclarationResolveScopeBasedTest : AbstractLazyDeclarationResolveScopeBasedTest() { + override val configurator = AnalysisApiFirScriptTestConfigurator(analyseInDependentSession = false) +} diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/resolve/OutOfContentRootLazyDeclarationResolveScopeBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/resolve/OutOfContentRootLazyDeclarationResolveScopeBasedTestGenerated.java new file mode 100644 index 00000000000..1b8f63ee877 --- /dev/null +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/resolve/OutOfContentRootLazyDeclarationResolveScopeBasedTestGenerated.java @@ -0,0 +1,140 @@ +/* + * 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.analysis.low.level.api.fir.resolve; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.util.KtTestUtil; +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.generators.tests.analysis.api.GenerateAnalysisApiTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("analysis/low-level-api-fir/testData/lazyResolveScopes") +@TestDataPath("$PROJECT_ROOT") +public class OutOfContentRootLazyDeclarationResolveScopeBasedTestGenerated extends AbstractOutOfContentRootLazyDeclarationResolveScopeBasedTest { + @Test + public void testAllFilesPresentInLazyResolveScopes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testData/lazyResolveScopes"), Pattern.compile("^(.+)\\.(kt)$"), null, true); + } + + @Test + @TestMetadata("anonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObject.kt"); + } + + @Test + @TestMetadata("class.kt") + public void testClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/class.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithImplicitTypeInsideAnonymousObject.kt") + public void testDelegateOverrideWithImplicitTypeInsideAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObject.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.kt") + public void testDelegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithImplicitTypeInsideClass.kt") + public void testDelegateOverrideWithImplicitTypeInsideClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClass.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithImplicitTypeInsideClassWithSubstitution.kt") + public void testDelegateOverrideWithImplicitTypeInsideClassWithSubstitution() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitution.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithoutImplicitTypeInsideAnonymousObject.kt") + public void testDelegateOverrideWithoutImplicitTypeInsideAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObject.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.kt") + public void testDelegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithoutImplicitTypeInsideClass.kt") + public void testDelegateOverrideWithoutImplicitTypeInsideClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClass.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithoutImplicitTypeInsideClassWithSubstitution.kt") + public void testDelegateOverrideWithoutImplicitTypeInsideClassWithSubstitution() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitution.kt"); + } + + @Test + @TestMetadata("intersectionOverride.kt") + public void testIntersectionOverride() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride.kt"); + } + + @Test + @TestMetadata("intersectionOverride2.kt") + public void testIntersectionOverride2() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2.kt"); + } + + @Test + @TestMetadata("intersectionOverrideWithImplicitTypeInsideAnonymousObject.kt") + public void testIntersectionOverrideWithImplicitTypeInsideAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObject.kt"); + } + + @Test + @TestMetadata("intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.kt") + public void testIntersectionOverrideWithoutImplicitTypeInsideAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.kt"); + } + + @Test + @TestMetadata("localClass.kt") + public void testLocalClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/localClass.kt"); + } + + @Test + @TestMetadata("substitutionOverrideWithImplicitTypeInsideAnonymousObject.kt") + public void testSubstitutionOverrideWithImplicitTypeInsideAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObject.kt"); + } + + @Test + @TestMetadata("substitutionOverrideWithImplicitTypeInsideClass.kt") + public void testSubstitutionOverrideWithImplicitTypeInsideClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClass.kt"); + } + + @Test + @TestMetadata("substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.kt") + public void testSubstitutionOverrideWithoutImplicitTypeInsideAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.kt"); + } + + @Test + @TestMetadata("substitutionOverrideWithoutImplicitTypeInsideClass.kt") + public void testSubstitutionOverrideWithoutImplicitTypeInsideClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClass.kt"); + } +} diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/resolve/ScriptLazyDeclarationResolveScopeBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/resolve/ScriptLazyDeclarationResolveScopeBasedTestGenerated.java new file mode 100644 index 00000000000..89088b86c9e --- /dev/null +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/resolve/ScriptLazyDeclarationResolveScopeBasedTestGenerated.java @@ -0,0 +1,146 @@ +/* + * 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.analysis.low.level.api.fir.resolve; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.util.KtTestUtil; +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.generators.tests.analysis.api.GenerateAnalysisApiTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("analysis/low-level-api-fir/testData/lazyResolveScopes") +@TestDataPath("$PROJECT_ROOT") +public class ScriptLazyDeclarationResolveScopeBasedTestGenerated extends AbstractScriptLazyDeclarationResolveScopeBasedTest { + @Test + public void testAllFilesPresentInLazyResolveScopes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testData/lazyResolveScopes"), Pattern.compile("^(.+)\\.(kts)$"), null, true); + } + + @Test + @TestMetadata("anonymousObjectScript.kts") + public void testAnonymousObjectScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObjectScript.kts"); + } + + @Test + @TestMetadata("classDeclarationsScript.kts") + public void testClassDeclarationsScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/classDeclarationsScript.kts"); + } + + @Test + @TestMetadata("classFromStatement.kts") + public void testClassFromStatement() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/classFromStatement.kts"); + } + + @Test + @TestMetadata("delegateOverrideWithImplicitTypeInsideAnonymousObjectScript.kts") + public void testDelegateOverrideWithImplicitTypeInsideAnonymousObjectScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectScript.kts"); + } + + @Test + @TestMetadata("delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitutionScript.kts") + public void testDelegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitutionScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitutionScript.kts"); + } + + @Test + @TestMetadata("delegateOverrideWithImplicitTypeInsideClassScript.kts") + public void testDelegateOverrideWithImplicitTypeInsideClassScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassScript.kts"); + } + + @Test + @TestMetadata("delegateOverrideWithImplicitTypeInsideClassWithSubstitutionScript.kts") + public void testDelegateOverrideWithImplicitTypeInsideClassWithSubstitutionScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitutionScript.kts"); + } + + @Test + @TestMetadata("delegateOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts") + public void testDelegateOverrideWithoutImplicitTypeInsideAnonymousObjectScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts"); + } + + @Test + @TestMetadata("delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitutionScript.kts") + public void testDelegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitutionScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitutionScript.kts"); + } + + @Test + @TestMetadata("delegateOverrideWithoutImplicitTypeInsideClassScript.kts") + public void testDelegateOverrideWithoutImplicitTypeInsideClassScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassScript.kts"); + } + + @Test + @TestMetadata("delegateOverrideWithoutImplicitTypeInsideClassWithSubstitutionScript.kts") + public void testDelegateOverrideWithoutImplicitTypeInsideClassWithSubstitutionScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitutionScript.kts"); + } + + @Test + @TestMetadata("intersectionOverride2Script.kts") + public void testIntersectionOverride2Script() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2Script.kts"); + } + + @Test + @TestMetadata("intersectionOverrideScript.kts") + public void testIntersectionOverrideScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideScript.kts"); + } + + @Test + @TestMetadata("intersectionOverrideWithImplicitTypeInsideAnonymousObjectScript.kts") + public void testIntersectionOverrideWithImplicitTypeInsideAnonymousObjectScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObjectScript.kts"); + } + + @Test + @TestMetadata("intersectionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts") + public void testIntersectionOverrideWithoutImplicitTypeInsideAnonymousObjectScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts"); + } + + @Test + @TestMetadata("localClassScript.kts") + public void testLocalClassScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/localClassScript.kts"); + } + + @Test + @TestMetadata("substitutionOverrideWithImplicitTypeInsideAnonymousObjectScript.kts") + public void testSubstitutionOverrideWithImplicitTypeInsideAnonymousObjectScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObjectScript.kts"); + } + + @Test + @TestMetadata("substitutionOverrideWithImplicitTypeInsideClassScript.kts") + public void testSubstitutionOverrideWithImplicitTypeInsideClassScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClassScript.kts"); + } + + @Test + @TestMetadata("substitutionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts") + public void testSubstitutionOverrideWithoutImplicitTypeInsideAnonymousObjectScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObjectScript.kts"); + } + + @Test + @TestMetadata("substitutionOverrideWithoutImplicitTypeInsideClassScript.kts") + public void testSubstitutionOverrideWithoutImplicitTypeInsideClassScript() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClassScript.kts"); + } +} diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/resolve/SourceLazyDeclarationResolveScopeBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/resolve/SourceLazyDeclarationResolveScopeBasedTestGenerated.java new file mode 100644 index 00000000000..c213a855a1d --- /dev/null +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/resolve/SourceLazyDeclarationResolveScopeBasedTestGenerated.java @@ -0,0 +1,140 @@ +/* + * 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.analysis.low.level.api.fir.resolve; + +import com.intellij.testFramework.TestDataPath; +import org.jetbrains.kotlin.test.util.KtTestUtil; +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.generators.tests.analysis.api.GenerateAnalysisApiTestsKt}. DO NOT MODIFY MANUALLY */ +@SuppressWarnings("all") +@TestMetadata("analysis/low-level-api-fir/testData/lazyResolveScopes") +@TestDataPath("$PROJECT_ROOT") +public class SourceLazyDeclarationResolveScopeBasedTestGenerated extends AbstractSourceLazyDeclarationResolveScopeBasedTest { + @Test + public void testAllFilesPresentInLazyResolveScopes() throws Exception { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("analysis/low-level-api-fir/testData/lazyResolveScopes"), Pattern.compile("^(.+)\\.(kt)$"), null, true); + } + + @Test + @TestMetadata("anonymousObject.kt") + public void testAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/anonymousObject.kt"); + } + + @Test + @TestMetadata("class.kt") + public void testClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/class.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithImplicitTypeInsideAnonymousObject.kt") + public void testDelegateOverrideWithImplicitTypeInsideAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObject.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.kt") + public void testDelegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideAnonymousObjectWithSubstitution.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithImplicitTypeInsideClass.kt") + public void testDelegateOverrideWithImplicitTypeInsideClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClass.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithImplicitTypeInsideClassWithSubstitution.kt") + public void testDelegateOverrideWithImplicitTypeInsideClassWithSubstitution() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithImplicitTypeInsideClassWithSubstitution.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithoutImplicitTypeInsideAnonymousObject.kt") + public void testDelegateOverrideWithoutImplicitTypeInsideAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObject.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.kt") + public void testDelegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideAnonymousObjectWithSubstitution.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithoutImplicitTypeInsideClass.kt") + public void testDelegateOverrideWithoutImplicitTypeInsideClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClass.kt"); + } + + @Test + @TestMetadata("delegateOverrideWithoutImplicitTypeInsideClassWithSubstitution.kt") + public void testDelegateOverrideWithoutImplicitTypeInsideClassWithSubstitution() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/delegateOverrideWithoutImplicitTypeInsideClassWithSubstitution.kt"); + } + + @Test + @TestMetadata("intersectionOverride.kt") + public void testIntersectionOverride() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride.kt"); + } + + @Test + @TestMetadata("intersectionOverride2.kt") + public void testIntersectionOverride2() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverride2.kt"); + } + + @Test + @TestMetadata("intersectionOverrideWithImplicitTypeInsideAnonymousObject.kt") + public void testIntersectionOverrideWithImplicitTypeInsideAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithImplicitTypeInsideAnonymousObject.kt"); + } + + @Test + @TestMetadata("intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.kt") + public void testIntersectionOverrideWithoutImplicitTypeInsideAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/intersectionOverrideWithoutImplicitTypeInsideAnonymousObject.kt"); + } + + @Test + @TestMetadata("localClass.kt") + public void testLocalClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/localClass.kt"); + } + + @Test + @TestMetadata("substitutionOverrideWithImplicitTypeInsideAnonymousObject.kt") + public void testSubstitutionOverrideWithImplicitTypeInsideAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideAnonymousObject.kt"); + } + + @Test + @TestMetadata("substitutionOverrideWithImplicitTypeInsideClass.kt") + public void testSubstitutionOverrideWithImplicitTypeInsideClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithImplicitTypeInsideClass.kt"); + } + + @Test + @TestMetadata("substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.kt") + public void testSubstitutionOverrideWithoutImplicitTypeInsideAnonymousObject() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideAnonymousObject.kt"); + } + + @Test + @TestMetadata("substitutionOverrideWithoutImplicitTypeInsideClass.kt") + public void testSubstitutionOverrideWithoutImplicitTypeInsideClass() throws Exception { + runTest("analysis/low-level-api-fir/testData/lazyResolveScopes/substitutionOverrideWithoutImplicitTypeInsideClass.kt"); + } +} diff --git a/generators/analysis-api-generator/tests/org/jetbrains/kotlin/generators/tests/analysis/api/firLowLevel.kt b/generators/analysis-api-generator/tests/org/jetbrains/kotlin/generators/tests/analysis/api/firLowLevel.kt index 36fd0b88513..c719055e8bc 100644 --- a/generators/analysis-api-generator/tests/org/jetbrains/kotlin/generators/tests/analysis/api/firLowLevel.kt +++ b/generators/analysis-api-generator/tests/org/jetbrains/kotlin/generators/tests/analysis/api/firLowLevel.kt @@ -19,8 +19,11 @@ import org.jetbrains.kotlin.analysis.low.level.api.fir.diagnostic.compiler.based import org.jetbrains.kotlin.analysis.low.level.api.fir.diagnostic.compiler.based.AbstractLLFirReversedBlackBoxCodegenBasedTest import org.jetbrains.kotlin.analysis.low.level.api.fir.file.structure.* import org.jetbrains.kotlin.analysis.low.level.api.fir.resolve.AbstractErrorResistanceTest +import org.jetbrains.kotlin.analysis.low.level.api.fir.resolve.AbstractOutOfContentRootLazyDeclarationResolveScopeBasedTest import org.jetbrains.kotlin.analysis.low.level.api.fir.resolve.AbstractOutOfContentRootWholeFileResolvePhaseTest +import org.jetbrains.kotlin.analysis.low.level.api.fir.resolve.AbstractScriptLazyDeclarationResolveScopeBasedTest import org.jetbrains.kotlin.analysis.low.level.api.fir.resolve.AbstractScriptWholeFileResolvePhaseTest +import org.jetbrains.kotlin.analysis.low.level.api.fir.resolve.AbstractSourceLazyDeclarationResolveScopeBasedTest import org.jetbrains.kotlin.analysis.low.level.api.fir.resolve.AbstractSourceWholeFileResolvePhaseTest import org.jetbrains.kotlin.generators.TestGroup import org.jetbrains.kotlin.generators.TestGroupSuite @@ -86,6 +89,18 @@ internal fun TestGroupSuite.generateFirLowLevelApiTests() { model("lazyResolveStdlibSources") } + testClass { + model("lazyResolveScopes", pattern = TestGeneratorUtil.KT) + } + + testClass { + model("lazyResolveScopes", pattern = TestGeneratorUtil.KT) + } + + testClass { + model("lazyResolveScopes", pattern = TestGeneratorUtil.KTS) + } + testClass { model("errorResistance") }