IR: check type parameter bounds equality in overrides
The code is exactly the same as in K1's `OverridingUtil.areTypeParametersEquivalent`. #KT-63442 Fixed
This commit is contained in:
committed by
Space Team
parent
560c1cacf3
commit
fc7de5ab97
+165
@@ -0,0 +1,165 @@
|
||||
FILE fqName:<root> fileName:/functionsDifferInTypeParameterBounds.kt
|
||||
CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
|
||||
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 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:B modality:OPEN visibility:public superTypes:[<root>.A]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.B [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[<root>.A]'
|
||||
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 declared in <root>.A
|
||||
$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 <root>.A
|
||||
$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 <root>.A
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS CLASS name:C modality:OPEN visibility:public superTypes:[<root>.A]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.C [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public superTypes:[<root>.A]'
|
||||
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 declared in <root>.A
|
||||
$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 <root>.A
|
||||
$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 <root>.A
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS CLASS name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.X
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.X [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Any]'
|
||||
FUN name:foo visibility:public modality:FINAL <S1> ($this:<root>.X, s:S1 of <root>.X.foo) returnType:kotlin.String
|
||||
TYPE_PARAMETER name:S1 index:0 variance: superTypes:[<root>.A] reified:false
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.X
|
||||
VALUE_PARAMETER name:s index:0 type:S1 of <root>.X.foo
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun foo <S1> (s: S1 of <root>.X.foo): kotlin.String declared in <root>.X'
|
||||
BLOCK type=kotlin.String origin=WHEN
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:S1 of <root>.X.foo [val]
|
||||
GET_VAR 's: S1 of <root>.X.foo declared in <root>.X.foo' type=S1 of <root>.X.foo origin=null
|
||||
WHEN type=kotlin.String origin=WHEN
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.B
|
||||
GET_VAR 'val tmp_0: S1 of <root>.X.foo declared in <root>.X.foo' type=S1 of <root>.X.foo origin=null
|
||||
then: CALL 'public abstract fun foo <S2> (s: S2 of <root>.X.foo): kotlin.String declared in <root>.X' type=kotlin.String origin=null
|
||||
<S2>: <root>.A
|
||||
$this: GET_VAR '<this>: <root>.X declared in <root>.X.foo' type=<root>.X origin=null
|
||||
s: GET_VAR 's: S1 of <root>.X.foo declared in <root>.X.foo' type=S1 of <root>.X.foo origin=null
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.C
|
||||
GET_VAR 'val tmp_0: S1 of <root>.X.foo declared in <root>.X.foo' type=S1 of <root>.X.foo origin=null
|
||||
then: CALL 'public abstract fun foo <S3> (s: S3 of <root>.X.foo): kotlin.String declared in <root>.X' type=kotlin.String origin=null
|
||||
<S3>: <root>.A
|
||||
$this: GET_VAR '<this>: <root>.X declared in <root>.X.foo' type=<root>.X origin=null
|
||||
s: GET_VAR 's: S1 of <root>.X.foo declared in <root>.X.foo' type=S1 of <root>.X.foo origin=null
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: THROW type=kotlin.Nothing
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (p0: @[FlexibleNullability] kotlin.Any?) declared in java.lang.AssertionError' type=java.lang.AssertionError origin=null
|
||||
p0: GET_VAR 's: S1 of <root>.X.foo declared in <root>.X.foo' type=S1 of <root>.X.foo origin=null
|
||||
FUN name:foo visibility:public modality:ABSTRACT <S2> ($this:<root>.X, s:S2 of <root>.X.foo) returnType:kotlin.String
|
||||
TYPE_PARAMETER name:S2 index:0 variance: superTypes:[<root>.B] reified:false
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.X
|
||||
VALUE_PARAMETER name:s index:0 type:S2 of <root>.X.foo
|
||||
FUN name:foo visibility:public modality:ABSTRACT <S3> ($this:<root>.X, s:S3 of <root>.X.foo) returnType:kotlin.String
|
||||
TYPE_PARAMETER name:S3 index:0 variance: superTypes:[<root>.C] reified:false
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.X
|
||||
VALUE_PARAMETER name:s index:0 type:S3 of <root>.X.foo
|
||||
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 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:Y modality:FINAL visibility:public superTypes:[<root>.X]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Y
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.Y [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.X'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Y modality:FINAL visibility:public superTypes:[<root>.X]'
|
||||
FUN name:foo visibility:public modality:OPEN <S4> ($this:<root>.Y, s:S4 of <root>.Y.foo) returnType:kotlin.String
|
||||
overridden:
|
||||
public abstract fun foo <S2> (s: S2 of <root>.X.foo): kotlin.String declared in <root>.X
|
||||
TYPE_PARAMETER name:S4 index:0 variance: superTypes:[<root>.B] reified:false
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Y
|
||||
VALUE_PARAMETER name:s index:0 type:S4 of <root>.Y.foo
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun foo <S4> (s: S4 of <root>.Y.foo): kotlin.String declared in <root>.Y'
|
||||
CONST String type=kotlin.String value="O"
|
||||
FUN name:foo visibility:public modality:OPEN <S5> ($this:<root>.Y, s:S5 of <root>.Y.foo) returnType:kotlin.String
|
||||
overridden:
|
||||
public abstract fun foo <S3> (s: S3 of <root>.X.foo): kotlin.String declared in <root>.X
|
||||
TYPE_PARAMETER name:S5 index:0 variance: superTypes:[<root>.C] reified:false
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Y
|
||||
VALUE_PARAMETER name:s index:0 type:S5 of <root>.Y.foo
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun foo <S5> (s: S5 of <root>.Y.foo): kotlin.String declared in <root>.Y'
|
||||
CONST String type=kotlin.String value="K"
|
||||
FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <S1> ($this:<root>.X, s:S1 of <root>.Y.foo) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public final fun foo <S1> (s: S1 of <root>.X.foo): kotlin.String declared in <root>.X
|
||||
TYPE_PARAMETER name:S1 index:0 variance: superTypes:[<root>.A] reified:false
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.X
|
||||
VALUE_PARAMETER name:s index:0 type:S1 of <root>.Y.foo
|
||||
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 declared in <root>.X
|
||||
$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 <root>.X
|
||||
$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 <root>.X
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS
|
||||
$this: CALL 'public open fun foo <S4> (s: S4 of <root>.Y.foo): kotlin.String declared in <root>.Y' type=kotlin.String origin=null
|
||||
<S4>: <root>.B
|
||||
$this: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Y' type=<root>.Y origin=null
|
||||
s: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.B' type=<root>.B origin=null
|
||||
other: CALL 'public open fun foo <S5> (s: S5 of <root>.Y.foo): kotlin.String declared in <root>.Y' type=kotlin.String origin=null
|
||||
<S5>: <root>.C
|
||||
$this: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Y' type=<root>.Y origin=null
|
||||
s: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.C' type=<root>.C origin=null
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
FILE fqName:<root> fileName:/functionsDifferInTypeParameterBounds.kt
|
||||
CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
|
||||
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 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:B modality:OPEN visibility:public superTypes:[<root>.A]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.B [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[<root>.A]'
|
||||
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 declared in <root>.A
|
||||
$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 <root>.A
|
||||
$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 <root>.A
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS CLASS name:C modality:OPEN visibility:public superTypes:[<root>.A]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.C [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public superTypes:[<root>.A]'
|
||||
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 declared in <root>.A
|
||||
$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 <root>.A
|
||||
$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 <root>.A
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS CLASS name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.X
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.X [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:X modality:ABSTRACT visibility:public superTypes:[kotlin.Any]'
|
||||
FUN name:foo visibility:public modality:FINAL <S1> ($this:<root>.X, s:S1 of <root>.X.foo) returnType:kotlin.String
|
||||
TYPE_PARAMETER name:S1 index:0 variance: superTypes:[<root>.A] reified:false
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.X
|
||||
VALUE_PARAMETER name:s index:0 type:S1 of <root>.X.foo
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun foo <S1> (s: S1 of <root>.X.foo): kotlin.String declared in <root>.X'
|
||||
BLOCK type=kotlin.String origin=WHEN
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:S1 of <root>.X.foo [val]
|
||||
GET_VAR 's: S1 of <root>.X.foo declared in <root>.X.foo' type=S1 of <root>.X.foo origin=null
|
||||
WHEN type=kotlin.String origin=WHEN
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.B
|
||||
GET_VAR 'val tmp_0: S1 of <root>.X.foo declared in <root>.X.foo' type=S1 of <root>.X.foo origin=null
|
||||
then: CALL 'public abstract fun foo <S2> (s: S2 of <root>.X.foo): kotlin.String declared in <root>.X' type=kotlin.String origin=null
|
||||
<S2>: <root>.B
|
||||
$this: GET_VAR '<this>: <root>.X declared in <root>.X.foo' type=<root>.X origin=null
|
||||
s: TYPE_OP type=<root>.B origin=IMPLICIT_CAST typeOperand=<root>.B
|
||||
GET_VAR 's: S1 of <root>.X.foo declared in <root>.X.foo' type=S1 of <root>.X.foo origin=null
|
||||
BRANCH
|
||||
if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=<root>.C
|
||||
GET_VAR 'val tmp_0: S1 of <root>.X.foo declared in <root>.X.foo' type=S1 of <root>.X.foo origin=null
|
||||
then: CALL 'public abstract fun foo <S3> (s: S3 of <root>.X.foo): kotlin.String declared in <root>.X' type=kotlin.String origin=null
|
||||
<S3>: <root>.C
|
||||
$this: GET_VAR '<this>: <root>.X declared in <root>.X.foo' type=<root>.X origin=null
|
||||
s: TYPE_OP type=<root>.C origin=IMPLICIT_CAST typeOperand=<root>.C
|
||||
GET_VAR 's: S1 of <root>.X.foo declared in <root>.X.foo' type=S1 of <root>.X.foo origin=null
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: THROW type=kotlin.Nothing
|
||||
CONSTRUCTOR_CALL 'public constructor <init> (p0: @[FlexibleNullability] kotlin.Any?) declared in java.lang.AssertionError' type=java.lang.AssertionError origin=null
|
||||
p0: GET_VAR 's: S1 of <root>.X.foo declared in <root>.X.foo' type=S1 of <root>.X.foo origin=null
|
||||
FUN name:foo visibility:public modality:ABSTRACT <S2> ($this:<root>.X, s:S2 of <root>.X.foo) returnType:kotlin.String
|
||||
TYPE_PARAMETER name:S2 index:0 variance: superTypes:[<root>.B] reified:false
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.X
|
||||
VALUE_PARAMETER name:s index:0 type:S2 of <root>.X.foo
|
||||
FUN name:foo visibility:public modality:ABSTRACT <S3> ($this:<root>.X, s:S3 of <root>.X.foo) returnType:kotlin.String
|
||||
TYPE_PARAMETER name:S3 index:0 variance: superTypes:[<root>.C] reified:false
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.X
|
||||
VALUE_PARAMETER name:s index:0 type:S3 of <root>.X.foo
|
||||
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 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:Y modality:FINAL visibility:public superTypes:[<root>.X]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Y
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.Y [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.X'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Y modality:FINAL visibility:public superTypes:[<root>.X]'
|
||||
FUN name:foo visibility:public modality:OPEN <S4> ($this:<root>.Y, s:S4 of <root>.Y.foo) returnType:kotlin.String
|
||||
overridden:
|
||||
public abstract fun foo <S2> (s: S2 of <root>.X.foo): kotlin.String declared in <root>.X
|
||||
TYPE_PARAMETER name:S4 index:0 variance: superTypes:[<root>.B] reified:false
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Y
|
||||
VALUE_PARAMETER name:s index:0 type:S4 of <root>.Y.foo
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun foo <S4> (s: S4 of <root>.Y.foo): kotlin.String declared in <root>.Y'
|
||||
CONST String type=kotlin.String value="O"
|
||||
FUN name:foo visibility:public modality:OPEN <S5> ($this:<root>.Y, s:S5 of <root>.Y.foo) returnType:kotlin.String
|
||||
overridden:
|
||||
public abstract fun foo <S3> (s: S3 of <root>.X.foo): kotlin.String declared in <root>.X
|
||||
TYPE_PARAMETER name:S5 index:0 variance: superTypes:[<root>.C] reified:false
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.Y
|
||||
VALUE_PARAMETER name:s index:0 type:S5 of <root>.Y.foo
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public open fun foo <S5> (s: S5 of <root>.Y.foo): kotlin.String declared in <root>.Y'
|
||||
CONST String type=kotlin.String value="K"
|
||||
FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <S1> ($this:<root>.X, s:S1 of <root>.Y.foo) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public final fun foo <S1> (s: S1 of <root>.X.foo): kotlin.String declared in <root>.X
|
||||
TYPE_PARAMETER name:S1 index:0 variance: superTypes:[<root>.A] reified:false
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.X
|
||||
VALUE_PARAMETER name:s index:0 type:S1 of <root>.Y.foo
|
||||
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 declared in <root>.X
|
||||
$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 <root>.X
|
||||
$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 <root>.X
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=PLUS
|
||||
$this: CALL 'public open fun foo <S4> (s: S4 of <root>.Y.foo): kotlin.String declared in <root>.Y' type=kotlin.String origin=null
|
||||
<S4>: <root>.B
|
||||
$this: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Y' type=<root>.Y origin=null
|
||||
s: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.B' type=<root>.B origin=null
|
||||
other: CALL 'public open fun foo <S5> (s: S5 of <root>.Y.foo): kotlin.String declared in <root>.Y' type=kotlin.String origin=null
|
||||
<S5>: <root>.C
|
||||
$this: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.Y' type=<root>.Y origin=null
|
||||
s: CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.C' type=<root>.C origin=null
|
||||
@@ -0,0 +1,26 @@
|
||||
// IGNORE_BACKEND_K2: WASM
|
||||
|
||||
// DUMP_IR
|
||||
// ^ Note that K2 IR dump has incorrectly inferred type arguments: KT-63846.
|
||||
|
||||
interface A
|
||||
open class B : A
|
||||
open class C : A
|
||||
|
||||
abstract class X {
|
||||
fun <S1 : A> foo(s: S1): String = when (s) {
|
||||
is B -> foo(s)
|
||||
is C -> foo(s)
|
||||
else -> throw AssertionError(s)
|
||||
}
|
||||
|
||||
abstract fun <S2 : B> foo(s: S2): String
|
||||
abstract fun <S3 : C> foo(s: S3): String
|
||||
}
|
||||
|
||||
class Y : X() {
|
||||
override fun <S4 : B> foo(s: S4): String = "O"
|
||||
override fun <S5 : C> foo(s: S5): String = "K"
|
||||
}
|
||||
|
||||
fun box(): String = Y().foo(B()) + Y().foo(C())
|
||||
@@ -0,0 +1,52 @@
|
||||
open class A
|
||||
open class B
|
||||
open class C
|
||||
|
||||
interface X {
|
||||
fun <T1, T2, T3> foo(t1: T1, t2: T2, t3: T3): String
|
||||
fun <T1, T2 : B, T3> foo(t1: T1, t2: T2, t3: T3): String
|
||||
fun <T1 : C, T2, T3 : A> foo(t1: T1, t2: T2, t3: T3): String
|
||||
fun <T1, T2 : A, T3 : B> foo(t1: T1, t2: T2, t3: T3): String
|
||||
|
||||
fun <T11 : A, T12 : B, T13 : C> foo(t1: T11, t2: T12, t3: T13): String
|
||||
fun <T21 : A, T22 : C, T23 : B> foo(t1: T21, t2: T22, t3: T23): String
|
||||
fun <T31 : B, T32 : A, T33 : C> foo(t1: T31, t2: T32, t3: T33): String
|
||||
fun <T41 : B, T42 : C, T43 : A> foo(t1: T41, t2: T42, t3: T43): String
|
||||
fun <T51 : C, T52 : A, T53 : B> foo(t1: T51, t2: T52, t3: T53): String
|
||||
fun <T61 : C, T62 : B, T63 : A> foo(t1: T61, t2: T62, t3: T63): String
|
||||
}
|
||||
|
||||
class Y : X {
|
||||
override fun <S1, S2, S3> foo(t1: S1, t2: S2, t3: S3): String = "___"
|
||||
override fun <S1, S2 : B, S3> foo(t1: S1, t2: S2, t3: S3): String = "_B_"
|
||||
override fun <S1 : C, S2, S3 : A> foo(t1: S1, t2: S2, t3: S3): String = "C_A"
|
||||
override fun <S1, S2 : A, S3 : B> foo(t1: S1, t2: S2, t3: S3): String = "_AB"
|
||||
|
||||
override fun <S11 : A, S12 : B, S13 : C> foo(t1: S11, t2: S12, t3: S13): String = "ABC"
|
||||
override fun <S21 : A, S22 : C, S23 : B> foo(t1: S21, t2: S22, t3: S23): String = "ACB"
|
||||
override fun <S31 : B, S32 : A, S33 : C> foo(t1: S31, t2: S32, t3: S33): String = "BAC"
|
||||
override fun <S41 : B, S42 : C, S43 : A> foo(t1: S41, t2: S42, t3: S43): String = "BCA"
|
||||
override fun <S51 : C, S52 : A, S53 : B> foo(t1: S51, t2: S52, t3: S53): String = "CAB"
|
||||
override fun <S61 : C, S62 : B, S63 : A> foo(t1: S61, t2: S62, t3: S63): String = "CBA"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val a = A()
|
||||
val b = B()
|
||||
val c = C()
|
||||
val y = Y()
|
||||
|
||||
if (y.foo("_", "_", "_") != "___") return "Fail ___"
|
||||
if (y.foo("_", b, "_") != "_B_") return "Fail _B_"
|
||||
if (y.foo(c, "_", a) != "C_A") return "Fail C_A"
|
||||
if (y.foo("_", a, b) != "_AB") return "Fail _AB"
|
||||
|
||||
if (y.foo(a, b, c) != "ABC") return "Fail ABC"
|
||||
if (y.foo(a, c, b) != "ACB") return "Fail ACB"
|
||||
if (y.foo(b, a, c) != "BAC") return "Fail BAC"
|
||||
if (y.foo(b, c, a) != "BCA") return "Fail BCA"
|
||||
if (y.foo(c, a, b) != "CAB") return "Fail CAB"
|
||||
if (y.foo(c, b, a) != "CBA") return "Fail CBA"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
interface A
|
||||
interface B
|
||||
interface C
|
||||
interface D
|
||||
interface Inv<T>
|
||||
|
||||
open class K
|
||||
|
||||
interface X {
|
||||
fun <T> foo(t: T): String where T : A, T : B, T : C, T : D
|
||||
fun <T> foo(t: T): String where T : K, T : Inv<B>, T : A?
|
||||
fun <T> foo(t: T): String where T : Inv<out Inv<in C>>, T : Any
|
||||
}
|
||||
|
||||
class Y : X {
|
||||
override fun <T> foo(t: T): String where T : A, T : C, T : B, T : D = "1"
|
||||
override fun <T> foo(t: T): String where T : K, T : A?, T : Inv<B> = "2"
|
||||
override fun <T> foo(t: T): String where T : Any, T : Inv<out Inv<in C>> = "3"
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val abcd = object : A, B, C, D {}
|
||||
val kab = object : K(), A, Inv<B> {}
|
||||
val iic = object : Inv<Inv<in C>> {}
|
||||
val y = Y()
|
||||
|
||||
if (y.foo(abcd) != "1") return "Fail 1"
|
||||
if (y.foo(kab) != "2") return "Fail 2"
|
||||
if (y.foo(iic) != "3") return "Fail 3"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user