forked from JetBrains/kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Substitute underlying constructor when substituting type alias constr…
…uctor KT-17426 Constructor call of typealiased class gets suspicious type arguemnts
- Loading branch information
Showing
5 changed files
with
89 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class A<Q>(val q: Q) | ||
|
||
typealias B<X> = A<X> | ||
|
||
typealias B2<T> = A<A<T>> | ||
|
||
fun bar() { | ||
val b = B(2) | ||
val b2 = B2(b) | ||
} |
25 changes: 25 additions & 0 deletions
25
compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
FILE /typeAliasCtorForGenericClass.kt | ||
CLASS CLASS A | ||
CONSTRUCTOR public constructor A<Q>(q: Q) | ||
BLOCK_BODY | ||
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()' | ||
INSTANCE_INITIALIZER_CALL classDescriptor='A' | ||
PROPERTY public final val q: Q | ||
FIELD PROPERTY_BACKING_FIELD public final val q: Q | ||
EXPRESSION_BODY | ||
GET_VAR 'value-parameter q: Q' type=Q origin=INITIALIZE_PROPERTY_FROM_PARAMETER | ||
FUN DEFAULT_PROPERTY_ACCESSOR public final fun <get-q>(): Q | ||
BLOCK_BODY | ||
RETURN type=kotlin.Nothing from='<get-q>(): Q' | ||
GET_FIELD 'q: Q' type=Q origin=null | ||
receiver: GET_VAR '<receiver: A>' type=A<Q> origin=null | ||
TYPEALIAS typealias B = A<X> type=A<X> | ||
TYPEALIAS typealias B2 = A<A<T>> type=A<A<T>> | ||
FUN public fun bar(): kotlin.Unit | ||
BLOCK_BODY | ||
VAR val b: B<kotlin.Int> /* = A<kotlin.Int> */ | ||
CALL 'constructor A(Int)' type=A<kotlin.Int> origin=null | ||
q: CONST Int type=kotlin.Int value='2' | ||
VAR val b2: B2<kotlin.Int> /* = A<A<kotlin.Int>> */ | ||
CALL 'constructor A(A<Int>)' type=A<A<kotlin.Int>> origin=null | ||
q: GET_VAR 'b: B<Int> /* = A<Int> */' type=B<kotlin.Int> /* = A<kotlin.Int> */ origin=null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters