FIR: fix type approximation by visibility
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
FILE: innerClassInAnonymousObject.kt
|
FILE: innerClassInAnonymousObject.kt
|
||||||
public final val x: R|<anonymous>| = object : R|kotlin/Any| {
|
public final val x: R|kotlin/Any| = object : R|kotlin/Any| {
|
||||||
private constructor(): R|<anonymous>| {
|
private constructor(): R|<anonymous>| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
@@ -16,4 +16,4 @@ FILE: innerClassInAnonymousObject.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public get(): R|<anonymous>|
|
public get(): R|kotlin/Any|
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ FILE: annotationArgumentKClassLiteralTypeError.kt
|
|||||||
public get(): R|kotlin/Array<kotlin/reflect/KClass<*>>|
|
public get(): R|kotlin/Array<kotlin/reflect/KClass<*>>|
|
||||||
|
|
||||||
}
|
}
|
||||||
public final val <reified T> R|T|.test: R|<anonymous><T>|
|
public final val <reified T> R|T|.test: R|kotlin/Any|
|
||||||
public get(): R|<anonymous><T>| {
|
public get(): R|<anonymous><T>| {
|
||||||
^ @R|Ann|(<implicitArrayOf>(<getClass>(R|T|), <getClass>(Q|kotlin/Array|))) object : R|kotlin/Any| {
|
^ @R|Ann|(<implicitArrayOf>(<getClass>(R|T|), <getClass>(Q|kotlin/Array|))) object : R|kotlin/Any| {
|
||||||
private constructor(): R|<anonymous><T>| {
|
private constructor(): R|<anonymous><T>| {
|
||||||
|
|||||||
+2
-2
@@ -90,14 +90,14 @@ FILE: conflictingOverloads.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public final val Companion: R|<anonymous>| = object : R|kotlin/Any| {
|
public final val Companion: R|kotlin/Any| = object : R|kotlin/Any| {
|
||||||
private constructor(): R|<anonymous>| {
|
private constructor(): R|<anonymous>| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public get(): R|<anonymous>|
|
public get(): R|kotlin/Any|
|
||||||
|
|
||||||
}
|
}
|
||||||
public final fun R|B|.foo(): R|kotlin/Unit| {
|
public final fun R|B|.foo(): R|kotlin/Unit| {
|
||||||
|
|||||||
+2
-2
@@ -21,7 +21,7 @@ FILE: localEntitytNotAllowed.kt
|
|||||||
public abstract interface X : R|kotlin/Any| {
|
public abstract interface X : R|kotlin/Any| {
|
||||||
}
|
}
|
||||||
|
|
||||||
public final val a: R|<anonymous>| = object : R|kotlin/Any| {
|
public final val a: R|kotlin/Any| = object : R|kotlin/Any| {
|
||||||
private constructor(): R|<anonymous>| {
|
private constructor(): R|<anonymous>| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
@@ -48,7 +48,7 @@ FILE: localEntitytNotAllowed.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public get(): R|<anonymous>|
|
public get(): R|kotlin/Any|
|
||||||
|
|
||||||
public final fun b(): R|kotlin/Unit| {
|
public final fun b(): R|kotlin/Unit| {
|
||||||
local final object E : R|kotlin/Any| {
|
local final object E : R|kotlin/Any| {
|
||||||
|
|||||||
+4
-4
@@ -20,7 +20,7 @@ FILE: privateObjectLiteral.kt
|
|||||||
public final val y: R|kotlin/Int| = this@R|/C|.R|/C.x|.R|/<anonymous>.foo|()
|
public final val y: R|kotlin/Int| = this@R|/C|.R|/C.x|.R|/<anonymous>.foo|()
|
||||||
public get(): R|kotlin/Int|
|
public get(): R|kotlin/Int|
|
||||||
|
|
||||||
internal final val z: R|<anonymous>| = object : R|kotlin/Any| {
|
internal final val z: R|kotlin/Any| = object : R|kotlin/Any| {
|
||||||
private constructor(): R|<anonymous>| {
|
private constructor(): R|<anonymous>| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
@@ -31,9 +31,9 @@ FILE: privateObjectLiteral.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal get(): R|<anonymous>|
|
internal get(): R|kotlin/Any|
|
||||||
|
|
||||||
public final val w: R|kotlin/Int| = this@R|/C|.R|/C.z|.R|/<anonymous>.foo|()
|
public final val w: R|ERROR CLASS: Unresolved name: foo| = this@R|/C|.R|/C.z|.<Unresolved name: foo>#()
|
||||||
public get(): R|kotlin/Int|
|
public get(): R|ERROR CLASS: Unresolved name: foo|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -9,5 +9,5 @@ class C {
|
|||||||
fun foo() = 13
|
fun foo() = 13
|
||||||
}
|
}
|
||||||
|
|
||||||
val w = z.foo() // ERROR!
|
val w = z.<!UNRESOLVED_REFERENCE{LT}!><!UNRESOLVED_REFERENCE{PSI}!>foo<!>()<!> // ERROR!
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -22,7 +22,7 @@ FILE: RedundantVisibilityModifierChecker.kt
|
|||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
|
|
||||||
internal final val z: R|<anonymous>| = object : R|kotlin/Any| {
|
internal final val z: R|kotlin/Any| = object : R|kotlin/Any| {
|
||||||
private constructor(): R|<anonymous>| {
|
private constructor(): R|<anonymous>| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
@@ -33,7 +33,7 @@ FILE: RedundantVisibilityModifierChecker.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal get(): R|<anonymous>|
|
internal get(): R|kotlin/Any|
|
||||||
|
|
||||||
}
|
}
|
||||||
public final class Foo2<T1, T2 : R|T1|> : R|kotlin/Any| {
|
public final class Foo2<T1, T2 : R|T1|> : R|kotlin/Any| {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
FILE: problems.kt
|
FILE: problems.kt
|
||||||
public final val sb: R|java/lang/StringBuilder| = R|java/lang/StringBuilder.StringBuilder|()
|
public final val sb: R|java/lang/StringBuilder| = R|java/lang/StringBuilder.StringBuilder|()
|
||||||
public get(): R|java/lang/StringBuilder|
|
public get(): R|java/lang/StringBuilder|
|
||||||
public final val o: R|<anonymous>| = object : R|kotlin/Any| {
|
public final val o: R|kotlin/Any| = object : R|kotlin/Any| {
|
||||||
private constructor(): R|<anonymous>| {
|
private constructor(): R|<anonymous>| {
|
||||||
super<R|kotlin/Any|>()
|
super<R|kotlin/Any|>()
|
||||||
}
|
}
|
||||||
@@ -15,7 +15,7 @@ FILE: problems.kt
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public get(): R|<anonymous>|
|
public get(): R|kotlin/Any|
|
||||||
public final fun test(): R|kotlin/Unit| {
|
public final fun test(): R|kotlin/Unit| {
|
||||||
local final class Local : R|kotlin/Any| {
|
local final class Local : R|kotlin/Any| {
|
||||||
public constructor(): R|Local| {
|
public constructor(): R|Local| {
|
||||||
|
|||||||
+52
-54
@@ -6,6 +6,8 @@
|
|||||||
package org.jetbrains.kotlin.fir.resolve.transformers.body.resolve
|
package org.jetbrains.kotlin.fir.resolve.transformers.body.resolve
|
||||||
|
|
||||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||||
|
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||||
|
import org.jetbrains.kotlin.descriptors.Visibility
|
||||||
import org.jetbrains.kotlin.fir.*
|
import org.jetbrains.kotlin.fir.*
|
||||||
import org.jetbrains.kotlin.fir.declarations.*
|
import org.jetbrains.kotlin.fir.declarations.*
|
||||||
import org.jetbrains.kotlin.fir.declarations.builder.buildValueParameter
|
import org.jetbrains.kotlin.fir.declarations.builder.buildValueParameter
|
||||||
@@ -45,6 +47,17 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
|||||||
private var containingClass: FirRegularClass? = null
|
private var containingClass: FirRegularClass? = null
|
||||||
private val statusResolver: FirStatusResolver = FirStatusResolver(session, scopeSession)
|
private val statusResolver: FirStatusResolver = FirStatusResolver(session, scopeSession)
|
||||||
|
|
||||||
|
private fun FirDeclaration.visibilityForApproximation(): Visibility {
|
||||||
|
if (this !is FirMemberDeclaration) return Visibilities.Local
|
||||||
|
val container = context.containers.getOrNull(context.containers.size - 2)
|
||||||
|
val containerVisibility =
|
||||||
|
if (container == null) Visibilities.Public
|
||||||
|
else (container as? FirRegularClass)?.visibility ?: Visibilities.Local
|
||||||
|
if (containerVisibility == Visibilities.Local || visibility == Visibilities.Local) return Visibilities.Local
|
||||||
|
if (containerVisibility == Visibilities.Private) return Visibilities.Private
|
||||||
|
return visibility
|
||||||
|
}
|
||||||
|
|
||||||
private inline fun <T> withFirArrayOfCallTransformer(block: () -> T): T {
|
private inline fun <T> withFirArrayOfCallTransformer(block: () -> T): T {
|
||||||
transformer.expressionsTransformer.enableArrayOfCallTransformation = true
|
transformer.expressionsTransformer.enableArrayOfCallTransformation = true
|
||||||
return try {
|
return try {
|
||||||
@@ -560,7 +573,9 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
|||||||
transformer,
|
transformer,
|
||||||
withExpectedType(
|
withExpectedType(
|
||||||
returnExpression.resultType.approximatedIfNeededOrSelf(
|
returnExpression.resultType.approximatedIfNeededOrSelf(
|
||||||
inferenceComponents.approximator, simpleFunction?.visibility, simpleFunction?.isInline == true
|
inferenceComponents.approximator,
|
||||||
|
simpleFunction?.visibilityForApproximation(),
|
||||||
|
simpleFunction?.isInline == true
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -990,67 +1005,50 @@ open class FirDeclarationsResolveTransformer(transformer: FirBodyResolveTransfor
|
|||||||
private fun storeVariableReturnType(variable: FirVariable<*>) {
|
private fun storeVariableReturnType(variable: FirVariable<*>) {
|
||||||
val initializer = variable.initializer
|
val initializer = variable.initializer
|
||||||
if (variable.returnTypeRef is FirImplicitTypeRef) {
|
if (variable.returnTypeRef is FirImplicitTypeRef) {
|
||||||
when {
|
val resultType = when {
|
||||||
initializer != null -> {
|
initializer != null -> {
|
||||||
val unwrappedInitializer = (initializer as? FirExpressionWithSmartcast)?.originalExpression ?: initializer
|
val unwrappedInitializer = (initializer as? FirExpressionWithSmartcast)?.originalExpression ?: initializer
|
||||||
val expectedType = when (val resultType = unwrappedInitializer.resultType) {
|
unwrappedInitializer.resultType
|
||||||
is FirImplicitTypeRef -> buildErrorTypeRef {
|
}
|
||||||
diagnostic = ConeSimpleDiagnostic("No result type for initializer", DiagnosticKind.InferenceError)
|
variable.getter != null && variable.getter !is FirDefaultPropertyAccessor -> variable.getter?.returnTypeRef
|
||||||
}
|
else -> null
|
||||||
else -> {
|
}
|
||||||
buildResolvedTypeRef {
|
if (resultType != null) {
|
||||||
type = resultType.coneType
|
val expectedType = when (resultType) {
|
||||||
annotations.addAll(resultType.annotations)
|
is FirImplicitTypeRef -> buildErrorTypeRef {
|
||||||
resultType.source?.fakeElement(FirFakeSourceElementKind.PropertyFromParameter)?.let {
|
diagnostic = ConeSimpleDiagnostic("No result type for initializer", DiagnosticKind.InferenceError)
|
||||||
source = it
|
}
|
||||||
}
|
else -> {
|
||||||
|
buildResolvedTypeRef {
|
||||||
|
type = resultType.coneType
|
||||||
|
annotations.addAll(resultType.annotations)
|
||||||
|
resultType.source?.fakeElement(FirFakeSourceElementKind.PropertyFromParameter)?.let {
|
||||||
|
source = it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
variable.transformReturnTypeRef(
|
}
|
||||||
transformer,
|
variable.transformReturnTypeRef(
|
||||||
withExpectedType(
|
transformer,
|
||||||
expectedType.approximatedIfNeededOrSelf(inferenceComponents.approximator, (variable as? FirProperty)?.visibility)
|
withExpectedType(
|
||||||
|
expectedType.approximatedIfNeededOrSelf(
|
||||||
|
inferenceComponents.approximator,
|
||||||
|
variable.visibilityForApproximation()
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
)
|
||||||
variable.getter != null && variable.getter !is FirDefaultPropertyAccessor -> {
|
} else {
|
||||||
val expectedType = when (val resultType = variable.getter?.returnTypeRef) {
|
variable.transformReturnTypeRef(
|
||||||
is FirImplicitTypeRef -> buildErrorTypeRef {
|
transformer,
|
||||||
diagnostic = ConeSimpleDiagnostic("No result type for getter", DiagnosticKind.InferenceError)
|
withExpectedType(
|
||||||
}
|
buildErrorTypeRef {
|
||||||
else -> {
|
diagnostic = ConeSimpleDiagnostic(
|
||||||
resultType?.let {
|
"Cannot infer variable type without initializer / getter / delegate",
|
||||||
buildResolvedTypeRef {
|
DiagnosticKind.InferenceError,
|
||||||
type = resultType.coneType
|
)
|
||||||
annotations.addAll(resultType.annotations)
|
},
|
||||||
resultType.source?.fakeElement(FirFakeSourceElementKind.PropertyFromParameter)?.let {
|
|
||||||
source = it
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
variable.transformReturnTypeRef(
|
|
||||||
transformer,
|
|
||||||
withExpectedType(
|
|
||||||
expectedType?.approximatedIfNeededOrSelf(inferenceComponents.approximator, (variable as? FirProperty)?.visibility)
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
}
|
)
|
||||||
else -> {
|
|
||||||
variable.transformReturnTypeRef(
|
|
||||||
transformer,
|
|
||||||
withExpectedType(
|
|
||||||
buildErrorTypeRef {
|
|
||||||
diagnostic = ConeSimpleDiagnostic(
|
|
||||||
"Cannot infer variable type without initializer / getter / delegate",
|
|
||||||
DiagnosticKind.InferenceError,
|
|
||||||
)
|
|
||||||
},
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (variable.getter?.returnTypeRef is FirImplicitTypeRef) {
|
if (variable.getter?.returnTypeRef is FirImplicitTypeRef) {
|
||||||
variable.getter?.transformReturnTypeRef(transformer, withExpectedType(variable.returnTypeRef))
|
variable.getter?.transformReturnTypeRef(transformer, withExpectedType(variable.returnTypeRef))
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.fir.types
|
|||||||
import org.jetbrains.kotlin.descriptors.Visibilities
|
import org.jetbrains.kotlin.descriptors.Visibilities
|
||||||
import org.jetbrains.kotlin.descriptors.Visibility
|
import org.jetbrains.kotlin.descriptors.Visibility
|
||||||
import org.jetbrains.kotlin.fir.*
|
import org.jetbrains.kotlin.fir.*
|
||||||
import org.jetbrains.kotlin.fir.declarations.classId
|
import org.jetbrains.kotlin.fir.declarations.FirAnonymousObject
|
||||||
import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic
|
import org.jetbrains.kotlin.fir.diagnostics.ConeSimpleDiagnostic
|
||||||
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
|
import org.jetbrains.kotlin.fir.resolve.fullyExpandedType
|
||||||
import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap
|
import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap
|
||||||
@@ -309,7 +309,8 @@ private fun FirTypeRef.hideLocalTypeIfNeeded(
|
|||||||
?.type as? ConeClassLikeType)
|
?.type as? ConeClassLikeType)
|
||||||
?.lookupTag as? ConeClassLookupTagWithFixedSymbol)
|
?.lookupTag as? ConeClassLookupTagWithFixedSymbol)
|
||||||
?.symbol?.fir
|
?.symbol?.fir
|
||||||
if (firClass?.classId?.isLocal != true) {
|
if (firClass !is FirAnonymousObject) {
|
||||||
|
// NB: local classes are acceptable here, but reported by EXPOSED_* checkers as errors
|
||||||
return this
|
return this
|
||||||
}
|
}
|
||||||
if (firClass.superTypeRefs.size > 1) {
|
if (firClass.superTypeRefs.size > 1) {
|
||||||
@@ -318,7 +319,7 @@ private fun FirTypeRef.hideLocalTypeIfNeeded(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
val superType = firClass.superTypeRefs.single()
|
val superType = firClass.superTypeRefs.single()
|
||||||
if (superType is FirResolvedTypeRef && !superType.isAny) {
|
if (superType is FirResolvedTypeRef) {
|
||||||
return superType
|
return superType
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// DONT_TARGET_EXACT_BACKEND: WASM
|
// DONT_TARGET_EXACT_BACKEND: WASM
|
||||||
// WASM_MUTE_REASON: PROPERTY_REFERENCES
|
// WASM_MUTE_REASON: PROPERTY_REFERENCES
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|||||||
+3
-3
@@ -20,11 +20,11 @@ private fun foo4(f: () -> Int) = object {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun test1(b: Boolean) {
|
fun test1(b: Boolean) {
|
||||||
var x = <!DEBUG_INFO_EXPRESSION_TYPE("<anonymous>")!>foo1 { 1 }<!>
|
var x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>foo1 { 1 }<!>
|
||||||
if (b) {
|
if (b) {
|
||||||
x = <!DEBUG_INFO_EXPRESSION_TYPE("<anonymous>")!>foo1 { 2 }<!>
|
x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>foo1 { 2 }<!>
|
||||||
}
|
}
|
||||||
x.bar()
|
x.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test2(b: Boolean) {
|
fun test2(b: Boolean) {
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ private fun foo4(f: () -> Int) = object {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun test1(b: Boolean) {
|
fun test1(b: Boolean) {
|
||||||
var x = <!DEBUG_INFO_EXPRESSION_TYPE("<anonymous>")!>foo1 { 1 }<!>
|
var x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>foo1 { 1 }<!>
|
||||||
if (b) {
|
if (b) {
|
||||||
x = <!DEBUG_INFO_EXPRESSION_TYPE("<anonymous>")!>foo1 { 2 }<!>
|
x = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>foo1 { 2 }<!>
|
||||||
}
|
}
|
||||||
x.bar()
|
x.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test2(b: Boolean) {
|
fun test2(b: Boolean) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ interface IFoo {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val test1: <no name provided>
|
val test1: Any
|
||||||
field = { // BLOCK
|
field = { // BLOCK
|
||||||
local class <no name provided> {
|
local class <no name provided> {
|
||||||
private constructor() /* primary */ {
|
private constructor() /* primary */ {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ FILE fqName:<root> fileName:/objectLiteralExpressions.kt
|
|||||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
PROPERTY name:test1 visibility:public modality:FINAL [val]
|
PROPERTY name:test1 visibility:public modality:FINAL [val]
|
||||||
FIELD PROPERTY_BACKING_FIELD name:test1 type:<root>.test1.<no name provided> visibility:private [final,static]
|
FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Any visibility:private [final,static]
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
BLOCK type=<root>.test1.<no name provided> origin=OBJECT_LITERAL
|
BLOCK type=<root>.test1.<no name provided> origin=OBJECT_LITERAL
|
||||||
CLASS CLASS name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
|
CLASS CLASS name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
|
||||||
@@ -40,11 +40,11 @@ FILE fqName:<root> fileName:/objectLiteralExpressions.kt
|
|||||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.test1.<no name provided>' type=<root>.test1.<no name provided> origin=OBJECT_LITERAL
|
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.test1.<no name provided>' type=<root>.test1.<no name provided> origin=OBJECT_LITERAL
|
||||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:<root>.test1.<no name provided>
|
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-test1> visibility:public modality:FINAL <> () returnType:kotlin.Any
|
||||||
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val]
|
correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val]
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): <root>.test1.<no name provided> declared in <root>'
|
RETURN type=kotlin.Nothing from='public final fun <get-test1> (): kotlin.Any declared in <root>'
|
||||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:<root>.test1.<no name provided> visibility:private [final,static]' type=<root>.test1.<no name provided> origin=null
|
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Any visibility:private [final,static]' type=kotlin.Any origin=null
|
||||||
PROPERTY name:test2 visibility:public modality:FINAL [val]
|
PROPERTY name:test2 visibility:public modality:FINAL [val]
|
||||||
FIELD PROPERTY_BACKING_FIELD name:test2 type:<root>.IFoo visibility:private [final,static]
|
FIELD PROPERTY_BACKING_FIELD name:test2 type:<root>.IFoo visibility:private [final,static]
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ object Z {
|
|||||||
|
|
||||||
get
|
get
|
||||||
|
|
||||||
val anObject: <no name provided>
|
val anObject: Any
|
||||||
field = { // BLOCK
|
field = { // BLOCK
|
||||||
local class <no name provided> {
|
local class <no name provided> {
|
||||||
private constructor() /* primary */ {
|
private constructor() /* primary */ {
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ FILE fqName:<root> fileName:/objectReference.kt
|
|||||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:private [final]' type=kotlin.Function0<kotlin.Unit> origin=null
|
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0<kotlin.Unit> visibility:private [final]' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||||
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z.<get-aLambda>' type=<root>.Z origin=null
|
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z.<get-aLambda>' type=<root>.Z origin=null
|
||||||
PROPERTY name:anObject visibility:public modality:FINAL [val]
|
PROPERTY name:anObject visibility:public modality:FINAL [val]
|
||||||
FIELD PROPERTY_BACKING_FIELD name:anObject type:<root>.Z.anObject.<no name provided> visibility:private [final]
|
FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:private [final]
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
BLOCK type=<root>.Z.anObject.<no name provided> origin=OBJECT_LITERAL
|
BLOCK type=<root>.Z.anObject.<no name provided> origin=OBJECT_LITERAL
|
||||||
CLASS CLASS name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
|
CLASS CLASS name:<no name provided> modality:FINAL visibility:local superTypes:[kotlin.Any]
|
||||||
@@ -156,12 +156,12 @@ FILE fqName:<root> fileName:/objectReference.kt
|
|||||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||||
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.Z.anObject.<no name provided>' type=<root>.Z.anObject.<no name provided> origin=OBJECT_LITERAL
|
CONSTRUCTOR_CALL 'private constructor <init> () [primary] declared in <root>.Z.anObject.<no name provided>' type=<root>.Z.anObject.<no name provided> origin=OBJECT_LITERAL
|
||||||
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-anObject> visibility:public modality:FINAL <> ($this:<root>.Z) returnType:<root>.Z.anObject.<no name provided>
|
FUN DEFAULT_PROPERTY_ACCESSOR name:<get-anObject> visibility:public modality:FINAL <> ($this:<root>.Z) returnType:kotlin.Any
|
||||||
correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val]
|
correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val]
|
||||||
$this: VALUE_PARAMETER name:<this> type:<root>.Z
|
$this: VALUE_PARAMETER name:<this> type:<root>.Z
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='public final fun <get-anObject> (): <root>.Z.anObject.<no name provided> declared in <root>.Z'
|
RETURN type=kotlin.Nothing from='public final fun <get-anObject> (): kotlin.Any declared in <root>.Z'
|
||||||
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:<root>.Z.anObject.<no name provided> visibility:private [final]' type=<root>.Z.anObject.<no name provided> origin=null
|
GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:anObject type:kotlin.Any visibility:private [final]' type=kotlin.Any origin=null
|
||||||
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z.<get-anObject>' type=<root>.Z origin=null
|
receiver: GET_VAR '<this>: <root>.Z declared in <root>.Z.<get-anObject>' type=<root>.Z origin=null
|
||||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||||
overridden:
|
overridden:
|
||||||
|
|||||||
@@ -63,8 +63,8 @@ fun case_6(x: EmptyClass) {
|
|||||||
|
|
||||||
// TESTCASE NUMBER: 7
|
// TESTCASE NUMBER: 7
|
||||||
fun case_7() {
|
fun case_7() {
|
||||||
if (anonymousTypeProperty == null || <!DEBUG_INFO_EXPRESSION_TYPE("<anonymous> & <anonymous>")!>anonymousTypeProperty<!> == null) {
|
if (anonymousTypeProperty == null || <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any & kotlin.Any")!>anonymousTypeProperty<!> == null) {
|
||||||
<!DEBUG_INFO_EXPRESSION_TYPE("<anonymous>")!>anonymousTypeProperty<!>
|
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any")!>anonymousTypeProperty<!>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user