FIR: in case of smart cast, use original type for FirThisRcvrExpression

Before this commit, we used type after smart cast both for original
FirThisReceiverExpression and for wrapping FirExpressionWithSmartCast.
However, this makes FIR2IR implicit cast generator work incorrectly
(it decides not to insert implicit cast because original type is the same).
After this commit, expressions have different types and implicit cast
generator works properly.
This commit is contained in:
Mikhail Glukhikh
2021-01-19 18:19:45 +03:00
parent 4fd4f504d0
commit 06ee768c6a
18 changed files with 988 additions and 797 deletions
@@ -2176,6 +2176,12 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest {
runTest("compiler/testData/ir/irText/firProblems/SignatureClash.kt");
}
@Test
@TestMetadata("SimpleTypeMarker.kt")
public void testSimpleTypeMarker() throws Exception {
runTest("compiler/testData/ir/irText/firProblems/SimpleTypeMarker.kt");
}
@Test
@TestMetadata("SyntheticSetterType.kt")
public void testSyntheticSetterType() throws Exception {
@@ -67,6 +67,8 @@ sealed class ImplicitReceiverValue<S : AbstractFirBasedSymbol<*>>(
final override var type: ConeKotlinType = type
private set
val originalType: ConeKotlinType = type
var implicitScope: FirTypeScope? = type.scope(useSiteSession, scopeSession, FakeOverrideTypeCalculator.DoNothing)
private set
@@ -78,7 +78,7 @@ open class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransform
implicitReceiver?.boundSymbol?.let {
callee.replaceBoundSymbol(it)
}
val implicitType = implicitReceiver?.type
val implicitType = implicitReceiver?.originalType
qualifiedAccessExpression.resultType = when {
implicitReceiver is InaccessibleImplicitReceiverValue -> buildErrorTypeRef {
source = qualifiedAccessExpression.source
@@ -1,35 +0,0 @@
inline fun <reified T : Any> Any.test1(): T? {
return when {
<this> is T -> <this>
else -> null
}
}
interface Foo<T : Any?> {
}
val <reified T : Any> Foo<T>.asT: T?
inline get(): T? {
return when {
<this> is T -> <this> /*as T */
else -> null
}
}
class Bar<T : Any?> {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
fun test(arg: Any) {
arg as T /*~> Unit */
<this>.useT(t = arg /*as T */)
}
fun useT(t: T) {
}
}
@@ -1,81 +0,0 @@
FILE fqName:<root> fileName:/implicitCastToTypeParameter.kt
FUN name:test1 visibility:public modality:FINAL <T> ($receiver:kotlin.Any) returnType:T of <root>.test1? [inline]
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any]
$receiver: VALUE_PARAMETER name:<this> type:kotlin.Any
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun test1 <T> (): T of <root>.test1? [inline] declared in <root>'
WHEN type=T of <root>.test1? origin=IF
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of <root>.test1
GET_VAR '<this>: kotlin.Any declared in <root>.test1' type=kotlin.Any origin=null
then: GET_VAR '<this>: kotlin.Any declared in <root>.test1' type=T of <root>.test1 origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Null type=kotlin.Nothing? value=null
CLASS INTERFACE name:Foo modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Foo<T of <root>.Foo>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
PROPERTY name:asT visibility:public modality:FINAL [val]
FUN name:<get-asT> visibility:public modality:FINAL <T> ($receiver:<root>.Foo<T of <root>.<get-asT>>) returnType:T of <root>.<get-asT>? [inline]
correspondingProperty: PROPERTY name:asT visibility:public modality:FINAL [val]
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any]
$receiver: VALUE_PARAMETER name:<this> type:<root>.Foo<T of <root>.<get-asT>>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun <get-asT> <T> (): T of <root>.<get-asT>? [inline] declared in <root>'
WHEN type=T of <root>.<get-asT>? origin=IF
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of <root>.<get-asT>
GET_VAR '<this>: <root>.Foo<T of <root>.<get-asT>> declared in <root>.<get-asT>' type=<root>.Foo<T of <root>.<get-asT>> origin=null
then: TYPE_OP type=T of <root>.<get-asT> origin=IMPLICIT_CAST typeOperand=T of <root>.<get-asT>
GET_VAR '<this>: <root>.Foo<T of <root>.<get-asT>> declared in <root>.<get-asT>' type=<root>.Foo<T of <root>.<get-asT>> origin=null
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: CONST Null type=kotlin.Nothing? value=null
CLASS CLASS name:Bar modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Bar<T of <root>.Bar>
TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?]
CONSTRUCTOR visibility:public <> () returnType:<root>.Bar<T of <root>.Bar> [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Bar modality:FINAL visibility:public superTypes:[kotlin.Any]'
FUN name:test visibility:public modality:FINAL <> ($this:<root>.Bar<T of <root>.Bar>, arg:kotlin.Any) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Bar<T of <root>.Bar>
VALUE_PARAMETER name:arg index:0 type:kotlin.Any
BLOCK_BODY
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
TYPE_OP type=T of <root>.Bar origin=CAST typeOperand=T of <root>.Bar
GET_VAR 'arg: kotlin.Any declared in <root>.Bar.test' type=kotlin.Any origin=null
CALL 'public final fun useT (t: T of <root>.Bar): kotlin.Unit declared in <root>.Bar' type=kotlin.Unit origin=null
$this: GET_VAR '<this>: <root>.Bar<T of <root>.Bar> declared in <root>.Bar.test' type=<root>.Bar<T of <root>.Bar> origin=null
t: TYPE_OP type=T of <root>.Bar origin=IMPLICIT_CAST typeOperand=T of <root>.Bar
GET_VAR 'arg: kotlin.Any declared in <root>.Bar.test' type=kotlin.Any origin=null
FUN name:useT visibility:public modality:FINAL <> ($this:<root>.Bar<T of <root>.Bar>, t:T of <root>.Bar) returnType:kotlin.Unit
$this: VALUE_PARAMETER name:<this> type:<root>.Bar<T of <root>.Bar>
VALUE_PARAMETER name:t index:0 type:T of <root>.Bar
BLOCK_BODY
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
inline fun <reified T : Any> Any.test1(): T? =
if (this is T) this else null
@@ -0,0 +1,39 @@
interface SimpleTypeMarker {
}
class SimpleType : SimpleTypeMarker {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
fun foo(): String {
return "OK"
}
}
interface User {
fun SimpleTypeMarker.bar(): String {
require(value = <this> is SimpleType)
return <this> /*as SimpleType */.foo()
}
}
class UserImpl {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
fun SimpleTypeMarker.bar(): String {
require(value = <this> is SimpleType)
return <this> /*as SimpleType */.foo()
}
}
@@ -0,0 +1,96 @@
FILE fqName:<root> fileName:/SimpleTypeMarker.kt
CLASS INTERFACE name:SimpleTypeMarker modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.SimpleTypeMarker
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:SimpleType modality:FINAL visibility:public superTypes:[<root>.SimpleTypeMarker]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.SimpleType
CONSTRUCTOR visibility:public <> () returnType:<root>.SimpleType [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SimpleType modality:FINAL visibility:public superTypes:[<root>.SimpleTypeMarker]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.SimpleType) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.SimpleType
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in <root>.SimpleType'
CONST String type=kotlin.String value="OK"
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS INTERFACE name:User modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.User
FUN name:bar visibility:public modality:OPEN <> ($this:<root>.User, $receiver:<root>.SimpleTypeMarker) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.User
$receiver: VALUE_PARAMETER name:<this> type:<root>.SimpleTypeMarker
BLOCK_BODY
CALL 'public final fun require (value: kotlin.Boolean): kotlin.Unit [inline] declared in kotlin.PreconditionsKt' type=kotlin.Unit origin=null
value: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.SimpleType
GET_VAR '<this>: <root>.SimpleTypeMarker declared in <root>.User.bar' type=<root>.SimpleTypeMarker origin=null
RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.String declared in <root>.User'
CALL 'public final fun foo (): kotlin.String declared in <root>.SimpleType' type=kotlin.String origin=null
$this: TYPE_OP type=<root>.SimpleType origin=IMPLICIT_CAST typeOperand=<root>.SimpleType
GET_VAR '<this>: <root>.SimpleTypeMarker declared in <root>.User.bar' type=<root>.SimpleTypeMarker origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:UserImpl modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.UserImpl
CONSTRUCTOR visibility:public <> () returnType:<root>.UserImpl [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:UserImpl modality:FINAL visibility:public superTypes:[kotlin.Any]'
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.UserImpl, $receiver:<root>.SimpleTypeMarker) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.UserImpl
$receiver: VALUE_PARAMETER name:<this> type:<root>.SimpleTypeMarker
BLOCK_BODY
CALL 'public final fun require (value: kotlin.Boolean): kotlin.Unit [inline] declared in kotlin.PreconditionsKt' type=kotlin.Unit origin=null
value: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.SimpleType
GET_VAR '<this>: <root>.SimpleTypeMarker declared in <root>.UserImpl.bar' type=<root>.SimpleTypeMarker origin=null
RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.String declared in <root>.UserImpl'
CALL 'public final fun foo (): kotlin.String declared in <root>.SimpleType' type=kotlin.String origin=null
$this: TYPE_OP type=<root>.SimpleType origin=IMPLICIT_CAST typeOperand=<root>.SimpleType
GET_VAR '<this>: <root>.SimpleTypeMarker declared in <root>.UserImpl.bar' type=<root>.SimpleTypeMarker origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -0,0 +1,22 @@
// WITH_RUNTIME
interface SimpleTypeMarker
class SimpleType : SimpleTypeMarker {
fun foo() = "OK"
}
interface User {
fun SimpleTypeMarker.bar(): String {
require(this is SimpleType)
return this.foo()
}
}
class UserImpl {
fun SimpleTypeMarker.bar(): String {
require(this is SimpleType)
return this.foo()
}
}
@@ -0,0 +1,39 @@
interface SimpleTypeMarker {
}
class SimpleType : SimpleTypeMarker {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
fun foo(): String {
return "OK"
}
}
interface User {
fun SimpleTypeMarker.bar(): String {
require(value = <this> is SimpleType)
return <this> /*as SimpleType */.foo()
}
}
class UserImpl {
constructor() /* primary */ {
super/*Any*/()
/* <init>() */
}
fun SimpleTypeMarker.bar(): String {
require(value = <this> is SimpleType)
return <this> /*as SimpleType */.foo()
}
}
@@ -0,0 +1,96 @@
FILE fqName:<root> fileName:/SimpleTypeMarker.kt
CLASS INTERFACE name:SimpleTypeMarker modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.SimpleTypeMarker
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:SimpleType modality:FINAL visibility:public superTypes:[<root>.SimpleTypeMarker]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.SimpleType
CONSTRUCTOR visibility:public <> () returnType:<root>.SimpleType [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SimpleType modality:FINAL visibility:public superTypes:[<root>.SimpleTypeMarker]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.SimpleType) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.SimpleType
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (): kotlin.String declared in <root>.SimpleType'
CONST String type=kotlin.String value="OK"
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in <root>.SimpleTypeMarker
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int [fake_override] declared in <root>.SimpleTypeMarker
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String [fake_override] declared in <root>.SimpleTypeMarker
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS INTERFACE name:User modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.User
FUN name:bar visibility:public modality:OPEN <> ($this:<root>.User, $receiver:<root>.SimpleTypeMarker) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.User
$receiver: VALUE_PARAMETER name:<this> type:<root>.SimpleTypeMarker
BLOCK_BODY
CALL 'public final fun require (value: kotlin.Boolean): kotlin.Unit [inline] declared in kotlin.PreconditionsKt' type=kotlin.Unit origin=null
value: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.SimpleType
GET_VAR '<this>: <root>.SimpleTypeMarker declared in <root>.User.bar' type=<root>.SimpleTypeMarker origin=null
RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.String declared in <root>.User'
CALL 'public final fun foo (): kotlin.String declared in <root>.SimpleType' type=kotlin.String origin=null
$this: TYPE_OP type=<root>.SimpleType origin=IMPLICIT_CAST typeOperand=<root>.SimpleType
GET_VAR '<this>: <root>.SimpleTypeMarker declared in <root>.User.bar' type=<root>.SimpleTypeMarker origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
CLASS CLASS name:UserImpl modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.UserImpl
CONSTRUCTOR visibility:public <> () returnType:<root>.UserImpl [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:UserImpl modality:FINAL visibility:public superTypes:[kotlin.Any]'
FUN name:bar visibility:public modality:FINAL <> ($this:<root>.UserImpl, $receiver:<root>.SimpleTypeMarker) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.UserImpl
$receiver: VALUE_PARAMETER name:<this> type:<root>.SimpleTypeMarker
BLOCK_BODY
CALL 'public final fun require (value: kotlin.Boolean): kotlin.Unit [inline] declared in kotlin.PreconditionsKt' type=kotlin.Unit origin=null
value: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.SimpleType
GET_VAR '<this>: <root>.SimpleTypeMarker declared in <root>.UserImpl.bar' type=<root>.SimpleTypeMarker origin=null
RETURN type=kotlin.Nothing from='public final fun bar (): kotlin.String declared in <root>.UserImpl'
CALL 'public final fun foo (): kotlin.String declared in <root>.SimpleType' type=kotlin.String origin=null
$this: TYPE_OP type=<root>.SimpleType origin=IMPLICIT_CAST typeOperand=<root>.SimpleType
GET_VAR '<this>: <root>.SimpleTypeMarker declared in <root>.UserImpl.bar' type=<root>.SimpleTypeMarker origin=null
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
overridden:
public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
overridden:
public open fun hashCode (): kotlin.Int declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
overridden:
public open fun toString (): kotlin.String declared in kotlin.Any
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
@@ -2176,6 +2176,12 @@ public class IrTextTestGenerated extends AbstractIrTextTest {
runTest("compiler/testData/ir/irText/firProblems/SignatureClash.kt");
}
@Test
@TestMetadata("SimpleTypeMarker.kt")
public void testSimpleTypeMarker() throws Exception {
runTest("compiler/testData/ir/irText/firProblems/SimpleTypeMarker.kt");
}
@Test
@TestMetadata("SyntheticSetterType.kt")
public void testSyntheticSetterType() throws Exception {
@@ -5,7 +5,7 @@
// TESTCASE NUMBER: 1
fun <T : List<T>> Inv<out T>.case_1() {
if (this is MutableList<*>) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableList<*> & Inv<out T> & kotlin.collections.MutableList<*> & Inv<out T>")!>this<!>
<!INAPPLICABLE_CANDIDATE!><!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableList<*> & Inv<out T> & kotlin.collections.MutableList<*> & Inv<out T>")!>this<!>[0] = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableList<*> & Inv<out T> & kotlin.collections.MutableList<*> & Inv<out T>")!>this<!>[1]<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableList<*> & Inv<out T> & Inv<out T>")!>this<!>
<!INAPPLICABLE_CANDIDATE!><!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableList<*> & Inv<out T> & Inv<out T>")!>this<!>[0] = <!DEBUG_INFO_EXPRESSION_TYPE("kotlin.collections.MutableList<*> & Inv<out T> & Inv<out T>")!>this<!>[1]<!>
}
}
@@ -54,16 +54,16 @@ fun case_3(a: Int?, b: Float?, c: Double?, d: Boolean?) {
}.apply {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number? & kotlin.Comparable<*>?")!>this<!>
if (this != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number & kotlin.Comparable<*>")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number & kotlin.Comparable<*>")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number & kotlin.Comparable<*>")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number & kotlin.Comparable<*>")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number & kotlin.Comparable<*>")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number & kotlin.Comparable<*>")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number & kotlin.Comparable<*>")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number & kotlin.Comparable<*>")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number & kotlin.Comparable<*>")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number & kotlin.Comparable<*>")!>this<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number? & kotlin.Comparable<*>?")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number? & kotlin.Comparable<*>?")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number? & kotlin.Comparable<*>?")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number? & kotlin.Comparable<*>?")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number? & kotlin.Comparable<*>?")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number? & kotlin.Comparable<*>?")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number? & kotlin.Comparable<*>?")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number? & kotlin.Comparable<*>?")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number? & kotlin.Comparable<*>?")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number & kotlin.Comparable<*> & kotlin.Number? & kotlin.Comparable<*>?")!>this<!>.funNullableAny()
}
}.let {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Number? & kotlin.Comparable<*>?")!>it<!>
@@ -97,16 +97,16 @@ fun case_4(a: Interface1?, b: Interface2?, c: Boolean) {
x.apply {
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2? & Interface1?")!>this<!>
if (this != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funNullableAny()
}
}
x.let {
@@ -140,16 +140,16 @@ fun case_5(a: Interface1?, b: Interface2?, d: Boolean) {
x.apply {
if (this != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2 & Interface1")!>this<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funNullableAny()
}
}
x.let {
@@ -182,20 +182,20 @@ fun case_6(a: Interface1?, b: Interface2, d: Boolean) {
x.apply {
this as Interface3
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>
if (this != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.itest1()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.itest2()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.itest1()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.itest2()
}
}
x.let {
@@ -232,20 +232,20 @@ fun case_7(a: Interface1?, b: Interface2?, d: Boolean) {
x.apply {
this as Interface3?
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3? & Interface2? & Interface1? & Interface3? & Interface2? & Interface1?")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3? & Interface2? & Interface1? & Interface2? & Interface1?")!>this<!>
if (this != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.itest1()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface3 & Interface2 & Interface1")!>this<!>.itest2()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.equals(null)
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propNullableT
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.propNullableAny
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funNullableT()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.funNullableAny()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.itest1()
<!DEBUG_INFO_EXPRESSION_TYPE("Interface3 & Interface2 & Interface1 & Interface2? & Interface1?")!>this<!>.itest2()
}
}
x.let {
File diff suppressed because it is too large Load Diff
@@ -14,8 +14,8 @@ fun case_1(vararg x: Int?) {
fun case_2(vararg x: Int?) {
x[0].apply {
if (this != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int")!>this<!>.inv()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int?")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int?")!>this<!>.inv()
}
}
@@ -39,8 +39,8 @@ fun <T> case_3(vararg x: T?) {
fun <T : Number?> case_4(vararg x: T?) {
x[0].apply {
if (this != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("T?!! & T?!!")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T?!! & T?!!")!>this<!>.toByte()
<!DEBUG_INFO_EXPRESSION_TYPE("T?!! & T?")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T?!! & T?")!>this<!>.toByte()
}
}
@@ -10,8 +10,8 @@
fun Int?.case_1() {
val x = this
if (x != null) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int")!>this<!>.inv()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int?")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int?")!>this<!>.inv()
}
}
@@ -48,6 +48,6 @@ fun Int?.case_3() {
fun Int?.case_4() {
val x = this
x!!
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int")!>this<!>.inv()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int?")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int & kotlin.Int?")!>this<!>.inv()
}
@@ -5,9 +5,9 @@
// TESTCASE NUMBER: 1
fun Any.case_1() {
if (this is Inv<*>) {
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & Inv<*>")!>this<!>.test()
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & Inv<*>")!>this<!>.prop_4
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & Inv<*>")!>this<!>.prop_4.inv()
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & kotlin.Any")!>this<!>.test()
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & kotlin.Any")!>this<!>.prop_4
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & kotlin.Any")!>this<!>.prop_4.inv()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>prop_4<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>prop_4<!>.inv()
}
@@ -16,9 +16,9 @@ fun Any.case_1() {
// TESTCASE NUMBER: 2
fun Any.case_2() {
if (this is ClassWithSixTypeParameters<*, *, *, *, *, *>) {
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *> & ClassWithSixTypeParameters<*, *, *, *, *, *>")!>this<!>.test()
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *> & ClassWithSixTypeParameters<*, *, *, *, *, *>")!>this<!>.x
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *> & ClassWithSixTypeParameters<*, *, *, *, *, *>")!>this<!>.y
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *> & kotlin.Any")!>this<!>.test()
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *> & kotlin.Any")!>this<!>.x
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *> & kotlin.Any")!>this<!>.y
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>y<!>
}
@@ -27,9 +27,9 @@ fun Any.case_2() {
// TESTCASE NUMBER: 3
fun <T> T.case_3() {
if (this is Inv<*>) {
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & T!! & Inv<*> & T!!")!>this<!>.test()
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & T!! & Inv<*> & T!!")!>this<!>.prop_4
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & T!! & Inv<*> & T!!")!>this<!>.prop_4.inv()
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & T!! & T")!>this<!>.test()
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & T!! & T")!>this<!>.prop_4
<!DEBUG_INFO_EXPRESSION_TYPE("Inv<*> & T!! & T")!>this<!>.prop_4.inv()
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>prop_4<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>prop_4<!>.inv()
}
@@ -38,9 +38,9 @@ fun <T> T.case_3() {
// TESTCASE NUMBER: 4
fun <T> T?.case_4() {
if (this is ClassWithSixTypeParameters<*, *, *, *, *, *>) {
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *> & T?!! & ClassWithSixTypeParameters<*, *, *, *, *, *> & T?!!")!>this<!>.test()
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *> & T?!! & ClassWithSixTypeParameters<*, *, *, *, *, *> & T?!!")!>this<!>.x
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *> & T?!! & ClassWithSixTypeParameters<*, *, *, *, *, *> & T?!!")!>this<!>.y
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *> & T?!! & T?")!>this<!>.test()
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *> & T?!! & T?")!>this<!>.x
<!DEBUG_INFO_EXPRESSION_TYPE("ClassWithSixTypeParameters<*, *, *, *, *, *> & T?!! & T?")!>this<!>.y
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Any?")!>y<!>
}
@@ -49,11 +49,11 @@ fun <T> T?.case_4() {
// TESTCASE NUMBER: 5
fun <T> ClassWithSixTypeParameters<out T, *, T, in T?, *, T>.case_5() {
if (this is InterfaceWithFiveTypeParameters1<*, *, *, *, *>) {
<!DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1<*, *, *, *, *> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T> & InterfaceWithFiveTypeParameters1<*, *, *, *, *> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T>")!>this<!>.itest1()
<!DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1<*, *, *, *, *> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T>")!>this<!>.itest1()
itest1()
<!DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1<*, *, *, *, *> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T> & InterfaceWithFiveTypeParameters1<*, *, *, *, *> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T>")!>this<!>.test()
<!DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1<*, *, *, *, *> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T> & InterfaceWithFiveTypeParameters1<*, *, *, *, *> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T>")!>this<!>.x
<!DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1<*, *, *, *, *> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T> & InterfaceWithFiveTypeParameters1<*, *, *, *, *> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T>")!>this<!>.y
<!DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1<*, *, *, *, *> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T>")!>this<!>.test()
<!DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1<*, *, *, *, *> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T>")!>this<!>.x
<!DEBUG_INFO_EXPRESSION_TYPE("InterfaceWithFiveTypeParameters1<*, *, *, *, *> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T> & ClassWithSixTypeParameters<out T, *, T, in T?, *, T>")!>this<!>.y
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>x<!>
<!DEBUG_INFO_EXPRESSION_TYPE("T")!>y<!>
}
@@ -98,8 +98,8 @@ fun <T> T.case_8() {
*/
fun <T> T.case_9() {
if (this is String) {
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String & T!! & kotlin.String & T!!")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String & T!! & kotlin.String & T!!")!>this<!>.length
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String & T!! & T")!>this<!>
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.String & T!! & T")!>this<!>.length
length
}
}