Commit 655fb78
Reflection: always compute JVM signature of built-in functions manually
This fixes "KotlinReflectionInternalError: Unknown origin" when
computing JVM signatures of functions which have no origin (neither Java
element, nor `@kotlin.Metadata`, nor `.kotlin_builtins`). Besides
`Enum.values/valueOf` and `Cloneable.clone` handled previously, this
also includes `invoke` of function types, which are synthesized by the
compiler during compilation.
The idea of this code was probably to make sure that all known cases of
functions without origin would be listed in the `isKnownBuiltInFunction`
function, because some built-ins might have a different JVM signature
than what is computed by the naive algorithm. However, it seems safer to
try to compute the JVM signature anyway than failing early.
The code in KT-83608 started to fail in 2.3.0 because of the bug fix
made in KT-79206. Previously, classifier for suspend function types was
incorrectly null, and it did not occur to me that some code might've
relied on this wrong behavior.
RCA: see above.
#KT-42199 Fixed
#KT-83608 Fixed
(cherry picked from commit 9e2049c)1 parent 58d3875 commit 655fb78
25 files changed
Lines changed: 149 additions & 16 deletions
File tree
- analysis/low-level-api-fir/tests-gen/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based
- compiler/testData
- codegen/box/reflection/builtins
- ir/irText/expressions/funInterface
- core/reflection.jvm/src/kotlin/reflect/jvm/internal
- js/js.tests
- klib-compatibility/tests-gen/org/jetbrains/kotlin/js/test/klib
- tests-gen/org/jetbrains/kotlin/js/test
- fir
- ir
- native/native.tests/codegen-box/tests-gen/org/jetbrains/kotlin/konan/test/blackbox
- wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test
Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
Lines changed: 1 addition & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
| 222 | + | |
227 | 223 | | |
228 | 224 | | |
229 | 225 | | |
| |||
254 | 250 | | |
255 | 251 | | |
256 | 252 | | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | 253 | | |
266 | 254 | | |
267 | 255 | | |
| |||
Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments