FIR mangler: fix alias-based type handling #KT-42770 Fixed

This commit is contained in:
Mikhail Glukhikh
2020-10-19 13:43:44 +03:00
parent 6251568e17
commit 44459e8ac7
6 changed files with 96 additions and 0 deletions
@@ -0,0 +1,34 @@
FILE fqName:<root> fileName:/SignatureClash.kt
TYPEALIAS name:Some visibility:public expandedType:kotlin.Function1<kotlin.Any, kotlin.String?>
CLASS OBJECT name:Factory modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Factory
CONSTRUCTOR visibility:private <> () returnType:<root>.Factory [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Factory modality:FINAL visibility:public superTypes:[kotlin.Any]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Factory, a:kotlin.String) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.Factory
VALUE_PARAMETER name:a index:0 type:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.String): kotlin.String declared in <root>.Factory'
CONST String type=kotlin.String value="Alpha"
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Factory, a:kotlin.String, f:kotlin.Function1<kotlin.Any, kotlin.String?>) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.Factory
VALUE_PARAMETER name:a index:0 type:kotlin.String
VALUE_PARAMETER name:f index:1 type:kotlin.Function1<kotlin.Any, kotlin.String?>
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.String, f: kotlin.Function1<kotlin.Any, kotlin.String?>): kotlin.String declared in <root>.Factory'
CONST String type=kotlin.String value="Omega"
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,12 @@
typealias Some = (Any) -> String?
object Factory {
fun foo(
a: String,
): String = "Alpha"
fun foo(
a: String,
f: Some
): String = "Omega"
}
@@ -0,0 +1,34 @@
FILE fqName:<root> fileName:/SignatureClash.kt
TYPEALIAS name:Some visibility:public expandedType:kotlin.Function1<kotlin.Any, kotlin.String?>
CLASS OBJECT name:Factory modality:FINAL visibility:public superTypes:[kotlin.Any]
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.Factory
CONSTRUCTOR visibility:private <> () returnType:<root>.Factory [primary]
BLOCK_BODY
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () [primary] declared in kotlin.Any'
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Factory modality:FINAL visibility:public superTypes:[kotlin.Any]'
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Factory, a:kotlin.String) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.Factory
VALUE_PARAMETER name:a index:0 type:kotlin.String
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.String): kotlin.String declared in <root>.Factory'
CONST String type=kotlin.String value="Alpha"
FUN name:foo visibility:public modality:FINAL <> ($this:<root>.Factory, a:kotlin.String, f:kotlin.Function1<kotlin.Any, kotlin.String?>{ <root>.Some }) returnType:kotlin.String
$this: VALUE_PARAMETER name:<this> type:<root>.Factory
VALUE_PARAMETER name:a index:0 type:kotlin.String
VALUE_PARAMETER name:f index:1 type:kotlin.Function1<kotlin.Any, kotlin.String?>{ <root>.Some }
BLOCK_BODY
RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.String, f: kotlin.Function1<kotlin.Any, kotlin.String?>{ <root>.Some }): kotlin.String declared in <root>.Factory'
CONST String type=kotlin.String value="Omega"
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