Svyatoslav Kuzmich
cb3b1f8ae2
[JS IR] Fix referencing Kotin variables in inline JS code
...
Fixed by outlining JS code that uses Kotlin variables making usages of
these locals explicit and preventing bugs due to one-sided variable renaming.
This prevents using Kotlin variables as lvalue in JS code.
2021-01-25 19:18:44 +03:00
Dmitry Petrov
708e6914bd
JVM JVM_IR hide sealed class constructors
2021-01-25 17:29:38 +03:00
Ilya Goncharov
a89fe90043
[JS IR] Add test on exportable overriden method
...
^KT-44415 fixed
2021-01-25 15:16:22 +03:00
Mikhail Glukhikh
afe335e504
FIR: serialize ExtensionFunctionType attribute
2021-01-23 10:56:37 +03:00
pyos
4a76ea6ecb
JVM: regenerate objects if they have been regenerated in parent contexts
...
This is a hack to work around the fact that type mappings should not be
inherited by inlining contexts for lambdas called from anonymous
objects. As the lambda can call the inline function again, this could
produce a reference to the original object, which is remapped to a new
type in the parent context. Unfortunately, there are many redundant
`MethodRemapper`s between the lambda and the class file, so simply
editing `TypeRemapper` does not work. Hence, this hack. For now.
(Issue found by compiling IntelliJ IDEA BTW.)
2021-01-22 13:39:20 +01:00
Ilmir Usmanov
704366e531
JVM: Mark suspend lambda receiver as used if callable reference
...
accesses it.
#KT-44131 Fixed
2021-01-21 12:47:59 +01:00
Mikhael Bogdanov
de00f72fa3
Generate linenumber for inline call site in case of implicit iterator/hasNext/next calls in for loop
...
Otherwise -1 is generated in smap
2021-01-21 12:04:09 +01:00
Ilmir Usmanov
952576e98f
JVM_IR: Do not unbox Result parameter if it not only one inline class
...
parameter, since in this case, the compiler generates a bridge, where
the result is unboxed.
2021-01-20 18:30:00 +01:00
Ilmir Usmanov
d48f92775b
JVM_IR: Do not unbox Result parameter in invoke if there is a bridge
...
since the bridge unboxes it.
#KT-44141 Fixed
2021-01-20 18:29:58 +01:00
Mikhael Bogdanov
147d60523d
Generate inline function arguments with parameters types
...
#KT-44429 Fixed
2021-01-20 15:23:08 +01:00
Ilya Goncharov
50ab9ed054
[JS IR] Add test on interface with default method calling extension method on super-interface
...
^KT-42176 fixed
2021-01-20 14:26:38 +03:00
Pavel Kirpichenkov
5c28762c02
Fix check for local classes in approximating string table
...
Take local/anonymous classes and their inner classes into account.
Simplify approximation: use first available super classifier instead
of first super class. This approximation should only happen for
private declarations that were not previously approximated by frontend.
So basically the only requirement for the approximated types is to be
denotable. Note that this only works if the types are not used later.
JVM uses a different string table implementatin as it needs exact
types of private members for reflection.
^KT-20996 Fixed
2021-01-20 11:05:53 +03:00
Pavel Kirpichenkov
b66f5c8180
Drop type aliases for JS and KLIB string tables
...
They used to use the same approximation logic anyway
^KT-20996
2021-01-20 11:05:53 +03:00
Pavel Kirpichenkov
2f3f75b512
Fix local anonymous class name error in K2MetadataCompiler
...
Extract the logic of approximating to denotable class supertype
from JS/KLIB and use it in metadata compiler.
^KT-20996 In Progress
2021-01-20 11:05:53 +03:00
Ilmir Usmanov
cce9469e6a
JVM_IR: Do not unbox Result parameter in Result methods
...
#KT-44140 Fixed
2021-01-20 06:27:15 +01:00
Ilmir Usmanov
b476f1cc3e
Minor. Change test to use the feature instead of suppressing error
2021-01-19 16:03:33 +01:00
pyos
29f95c7df2
FIR: improve inference of implicit type arguments in casts
...
Type parameters do not necessarily match one-to-one, or preserve order.
2021-01-18 18:01:03 +03:00
Mads Ager
250cc1dc92
[JVM] Never treat arguments to methods as locals that can be removed.
...
Fixes KT-44347
2021-01-15 10:33:11 +03:00
Alexander Udalov
e0363788f4
Remove some remaining tests on old coroutines
2021-01-13 19:16:31 +01:00
Zalim Bashorov
47c4197098
[JS old] Revert fix made for KT-44221 in ab753625
...
And mute the test for old BE.
#KT-44221 Open
2021-01-13 01:22:17 +03:00
Dmitriy Novozhilov
e0cd830a0e
[Test] Drop codegen tests for experimental coroutines
...
Experimental coroutines was deprecated in Kotlin 1.3,
so since Kotlin 1.5 we don't support (and don't test) them
2021-01-12 18:35:18 +03:00
Svyatoslav Kuzmich
ab753625fe
[JS Legacy] Fix returning Char from suspend functions (KT-44221)
...
Mark translated expression with a proper type, like we do with
non-suspending calls, to coerce it later.
2021-01-12 15:42:31 +03:00
Svyatoslav Kuzmich
2d88ff6fb2
[JS IR] Fix unsgined integer default arguemtns (KT-44180)
...
Const lowering didn't exprect null constants with unsigned number
types and crashed with NPE. This commit fixes that.
2021-01-12 15:42:31 +03:00
Mads Ager
dfc86feecd
[IR] Extend test coverage for smart cast handling.
2021-01-11 12:01:48 +03:00
Alexander Udalov
ed9a0e514d
Regenerate tests and fir-tree
2021-01-03 14:53:41 +01:00
Shagen Ogandzhanian
96de9144de
[JS IR] Generate stub for exported functions with default params
...
see https://youtrack.jetbrains.com/issue/KT-43407
2020-12-31 20:21:21 +01:00
Alexander Udalov
bf3f6594d5
IR: do not lose $default function annotations when generating calls
...
Losing an annotation like `JvmName` resulted in the incorrect bytecode
generated in the JVM IR backend.
#KT-44160 Fixed
2020-12-31 18:36:24 +01:00
Svyatoslav Kuzmich
b6ad1584c9
[Wasm] Improve interface method dispatch
...
- Use typed Wasm tables for each interface method to avoid runtime
function type check
- Use linear search by implemented interface rather than by individual
virtual function signature
2020-12-30 19:29:10 +03:00
Shagen Ogandzhanian
e7dc199ad7
Init enum entries whenever we access companion object or accessing valueOf
...
Fixes https://youtrack.jetbrains.com/issue/KT-43987
Fixes https://youtrack.jetbrains.com/issue/KT-43989
2020-12-30 14:54:34 +01:00
Dmitry Petrov
7fa04afda2
JVM_IR KT-32115 fix $$delegatedProperties initialization in enum
2020-12-30 15:56:18 +03:00
Dmitry Petrov
81e00ca371
JVM box tests for KT-30402
2020-12-30 10:57:46 +03:00
Shagen Ogandzhanian
55a5695fc0
[JS] Forbid export of interfaces
...
With the only exception of external interfaces.
See https://youtrack.jetbrains.com/issue/KT-44099
2020-12-29 20:43:57 +01:00
Victor Petukhov
30a5eee481
Don't approximate abbreviation during substitution it as it can't be projected at top-level
...
^KT-42036 Fixed
2020-12-29 16:08:38 +03:00
Alexander Udalov
77a9d14f93
Capitalize/decapitalize only ASCII characters across project
...
Use {de,}capitalizeAsciiOnly and to{Lower,Upper}CaseAsciiOnly where
possible, and stdlib's functions with Locale.US everywhere else.
Otherwise, if the default system locale is Turkish, the capital latin
letter "I" is transformed in toLowerCase to "ı" (see
https://github.com/JetBrains/kotlin/blob/66bc142f92085047a1ca64f9a291f0496e33dd98/libraries/stdlib/jvm/test/text/StringJVMTest.kt#L119 ),
which for example breaks the codegen for `intArrayOf` in
KT-25400/KT-43405.
Similarly, lower case latin letter "i" is transformed to "İ".
#KT-13631 Fixed
#KT-25400 Fixed
#KT-43405 Fixed
2020-12-28 16:10:30 +01:00
Dmitry Petrov
5d4b0b19d4
JVM_IR KT-13213 split string constants into parts of acceptable length
2020-12-28 16:50:29 +03:00
Victor Petukhov
37473ad640
Substitute lambda's receiver type during completion including the builder inference stub variables substitution
...
^KT-42175 Fixed
2020-12-25 21:33:37 +03:00
Svyatoslav Kuzmich
672859d447
[Wasm] Support init blocks in inline classes
2020-12-25 17:00:23 +03:00
Victor Petukhov
7ed6aae46e
Fix tests after rebasing
2020-12-25 11:53:21 +03:00
Victor Petukhov
1926434b18
Report error about uninferred type parameter for some special call' subcalls
2020-12-25 11:53:14 +03:00
Dmitry Petrov
9715ae88fe
Minor: regenerate tests
2020-12-25 09:15:47 +03:00
Zalim Bashorov
f7b0f55532
[JS IR test] Add an ability to setup phases to dump after and phases to validate after in box tests using system properties
2020-12-24 20:03:24 +03:00
Zalim Bashorov
df6635085b
[JS IR] Replace calls with invalid type arguments for type parameters with call to errorCode function from runtime.
2020-12-24 20:03:22 +03:00
Dmitry Petrov
a1574bf50a
JVM box tests for KT-30548
2020-12-24 19:35:36 +03:00
Dmitry Petrov
d3349197ba
Minor: regenerate tests
2020-12-23 21:50:12 +03:00
Dmitry Petrov
3f7a776fb8
JVM box tests for KT-21092
2020-12-23 21:50:07 +03:00
Dmitry Petrov
9f908cdf7c
JVM box tests for KT-16752
2020-12-23 21:50:05 +03:00
Jinseong Jeon
aaa3f2e2c1
FIR2IR: correct IR origin for substitution overrides
...
#KT-44054 Fixed
2020-12-23 16:13:05 +03:00
Jinseong Jeon
34dbbdce07
FIR2IR: use lookupTag or class to getLocalClass, not classId
...
Before this commit, we sometimes tried to fetch anonymous object by id,
getting sometimes a wrong result because it's singleton.
Now we use lookupTag or FIR class itself instead.
#KT-44050 Fixed
2020-12-23 16:12:58 +03:00
Dmitry Petrov
632f5af442
Minor: kt21014.kt - add JVM_TARGET 1.8
2020-12-23 11:25:36 +03:00
Dmitry Petrov
3ae8521f12
Minor: drop kt21014.kt (SIGSEGV on HotSpot 6.0_45-b06)
2020-12-22 19:56:54 +03:00