-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KT-42151 fix type arguments in local class constructor reference types
- Loading branch information
Showing
22 changed files
with
678 additions
and
32 deletions.
There are no files selected for viewing
5 changes: 5 additions & 0 deletions
5
...ler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
5 changes: 5 additions & 0 deletions
5
compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
1 change: 0 additions & 1 deletion
1
compiler/testData/codegen/box/callableReference/genericConstructorReference.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
25 changes: 25 additions & 0 deletions
25
compiler/testData/codegen/box/callableReference/genericLocalClassConstructorReference.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,25 @@ | ||
// DONT_TARGET_EXACT_BACKEND: WASM | ||
// WASM_MUTE_REASON: BINDING_RECEIVERS | ||
|
||
// IGNORE_BACKEND_FIR: JVM_IR | ||
// KT-42025 | ||
|
||
open class L<LL>(val ll: LL) | ||
|
||
class Rec<T>(val rt: T) | ||
|
||
fun <FT> Rec<FT>.fn(): L<FT> { | ||
class FLocal<LT>(lt: LT, val pt: FT): L<LT>(lt) | ||
return foo2(rt, rt, ::FLocal) | ||
} | ||
|
||
val <PT> Rec<PT>.p: L<PT> | ||
get() { | ||
class PLocal<LT>(lt: LT, val pt: PT): L<LT>(lt) | ||
return foo2(rt, rt, ::PLocal) | ||
} | ||
|
||
fun <T1, T2, R> foo2(t1: T1, t2: T2, bb: (T1, T2) -> R): R = bb(t1, t2) | ||
|
||
fun box(): String = | ||
Rec("O").fn().ll + Rec("K").p.ll |
64 changes: 64 additions & 0 deletions
64
...ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.fir.kt.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,64 @@ | ||
open class L<LL : Any?> { | ||
constructor(ll: LL) /* primary */ { | ||
super/*Any*/() | ||
/* <init>() */ | ||
|
||
} | ||
|
||
val ll: LL | ||
field = ll | ||
get | ||
|
||
} | ||
|
||
class Rec<T : Any?> { | ||
constructor(rt: T) /* primary */ { | ||
super/*Any*/() | ||
/* <init>() */ | ||
|
||
} | ||
|
||
val rt: T | ||
field = rt | ||
get | ||
|
||
} | ||
|
||
val <PT : Any?> Rec<PT>.p: L<PT> | ||
get(): L<PT> { | ||
local class PLocal<LT : Any?> : L<LT> { | ||
constructor(lt: LT, pt: PT) /* primary */ { | ||
super/*L*/<LT>(ll = lt) | ||
/* <init>() */ | ||
|
||
} | ||
|
||
val pt: PT | ||
field = pt | ||
get | ||
|
||
} | ||
|
||
return foo2<PT, PT, PLocal<PT>>(t1 = <this>.<get-rt>(), t2 = <this>.<get-rt>(), bb = PLocal::<init>/*<PT>()*/) | ||
} | ||
|
||
fun <FT : Any?> Rec<FT>.fn(): L<FT> { | ||
local class FLocal<LT : Any?> : L<LT> { | ||
constructor(lt: LT, pt: FT) /* primary */ { | ||
super/*L*/<LT>(ll = lt) | ||
/* <init>() */ | ||
|
||
} | ||
|
||
val pt: FT | ||
field = pt | ||
get | ||
|
||
} | ||
|
||
return foo2<FT, FT, FLocal<FT>>(t1 = <this>.<get-rt>(), t2 = <this>.<get-rt>(), bb = FLocal::<init>/*<FT>()*/) | ||
} | ||
|
||
fun <T1 : Any?, T2 : Any?, R : Any?> foo2(t1: T1, t2: T2, bb: Function2<T1, T2, R>): R { | ||
return bb.invoke(p1 = t1, p2 = t2) | ||
} |
Oops, something went wrong.