Dmitry Petrov
b1b87becc8
PSI2IR more JVM-like exhaustive when behavior KT-36840
2020-10-21 20:07:11 +03:00
Ilya Goncharov
14d9aa1660
Add test on break in when without label
...
^KT-42262 fixed
2020-10-21 16:59:24 +03:00
pyos
a4b67f007f
JVM_IR: treat suspend-converted references as lambdas for inlining
...
Again, this is consistent with adapted function references, since
they're pretty much the same anyway.
2020-10-21 15:21:01 +02:00
pyos
5c55f67923
JVM_IR: generate shorter names for classes in delegate initializers
...
#KT-41493 Fixed
2020-10-20 21:14:44 +02:00
Dmitry Petrov
3979cde738
Add box and PSI2IR tests for special cases listed in KT-35849
2020-10-20 19:31:40 +03:00
Dmitry Petrov
47c784f023
JVM_IR fix Java wildcard types translation
...
Types such as 'Collection<? extends CharSequence>' are treated as
'(kotlin.collections.MutableCollection<out kotlin.CharSequence!>
..kotlin.collections.Collection<kotlin.CharSequence!>?)'
by the front-end.
When generating generic signatures, JVM BE takes lower bound (which is
'kotlin.collections.MutableCollection<out kotlin.CharSequence!>').
Emulate this behavior in TypeTranslator.
2020-10-19 20:52:53 +03:00
Ilmir Usmanov
70a4ed3ebc
Box inline class returned from suspend lambda non-locally
...
All inline classes should be boxed coming in and out of lambdas,
however, if the inline class was returned non-locally, it was not boxed.
This change fixes the issue in Old JVM BE.
#KT-41194 In progress
2020-10-19 14:28:36 +02:00
Roman Artemev
d7db643422
Add box test for KT-33992
2020-10-16 16:02:02 +03:00
Roman Artemev
023a62395a
Add box test for KT-36897
2020-10-16 16:02:01 +03:00
pyos
a9b53adc50
JVM_IR: make primitive == object slightly less lazy.
...
Discarding the value used to leave an unused-but-never-destroyed
temporary variable. It's best to not separate calls to `enterTemp`
and `leaveTemp`.
Not sure what kind of test to add though, since this is minor -- if the
result of the comparison is discarded, then the entire statement is more
or less pointless.
#KT-42251 Fixed
2020-10-16 12:25:55 +02:00
Pavel Kirpichenkov
d769ca06ab
Add test for KT-25114
2020-10-16 11:11:58 +03:00
Victor Petukhov
c6da2a1138
Reuse built functional types for postponed arguments by expected types and paths from a top level type variable
...
^KT-42221 Fixed
2020-10-16 10:46:22 +03:00
Dmitry Petrov
ee5edf4caa
JVM_IR fix 'remove' in inline class implementing MutableCollection
2020-10-16 00:02:12 +03:00
Mikhael Bogdanov
c8e84f82eb
Proper check NON_JVM_DEFAULT_OVERRIDES_JAVA_DEFAULT in new jvm-default modes
...
#KT-42699 Fixed
2020-10-15 16:26:00 +02:00
Mikhael Bogdanov
b6dc99b98e
Skip java defaults in EXPLICIT_OVERRIDE_REQUIRED_IN_MIXED_MODE check
...
#KT-42674 Fixed
2020-10-15 16:26:00 +02:00
Jinseong Jeon
ea2f773e54
FIR checker: reproduce KT-42350
2020-10-15 14:22:38 +03:00
Mikhail Zarechenskiy
eacc94a89d
Do not hide synthetic properties except isEmpty from Java
...
In order to hide synthetic property isEmpty from JDK 15, there was
added additional logic in 5cc12b49fc but
it also lead to the fact that now it's impossible to call synthetic
property `declaringClass` on `Enum` as it's in the same list as method
isEmpty(). Note that it's questionable behavior, probably we should
also hide `declaringClass` as well but for now we turn it back to
preserve compatibility
#KT-42467 Fixed
2020-10-15 12:26:17 +03:00
Jinseong Jeon
65545a10c4
FIR: reproduce KT-42656
2020-10-15 08:47:46 +03:00
Ilya Kirillov
5cda4b5ab3
fix test generator compilation
2020-10-14 22:11:12 +03:00
Ilya Kirillov
dc467f7d6c
FIR: add test which checks that we do not access lazy bodies & lazy expressions till contract phase
2020-10-14 22:11:04 +03:00
Ilya Kirillov
bbf450703f
FIR: introduce stub bodies raw fir test case
2020-10-14 22:10:56 +03:00
Alexander Udalov
fbf56c054b
JVM IR: fix names of $annotations methods for internal properties
...
#KT-40384 Fixed
2020-10-14 19:32:51 +02:00
Alexander Udalov
3f73be391f
JVM IR: fix names of $annotations methods with inline classes in signature
...
#KT-40385 Fixed
2020-10-14 19:31:58 +02:00
Dmitry Petrov
d623f4d1d6
Add test for KT-40190
2020-10-14 16:05:15 +03:00
Alexander.Likhachev
72ad581fe4
[Gradle, K/N] Change prefix of apple-specific tests to native-*
...
The commit does nothing but renaming of directories
2020-10-14 15:10:34 +03:00
Dmitry Petrov
052f345a17
JVM_IR no generic signatures for abstract stubs KT-42609
2020-10-13 19:20:29 +03:00
Alexander Udalov
1b39a235d8
JVM IR: sort multifile part names in metadata
2020-10-13 16:40:53 +02:00
Pavel Kirpichenkov
9dd3d8fb14
[NI] Fix extension function check after commonization
...
`isExtensionFunction` property is false for suspend functions
2020-10-13 11:00:21 +03:00
Pavel Kirpichenkov
712a2ce1ab
[FIR] Improved lambda completion: initial implementation
...
Repeat the logic of KotlinConstraintSystemCompleter in ConstraintSystemCompleter.
Implement additional context operations required for updated lambda completion algorithm.
2020-10-13 11:00:21 +03:00
Victor Petukhov
0685beb765
NI: do substitution type variables during updating trace for lambda (these type variables can appear after the builder inference)
...
^KT-42450 Fixed
2020-10-13 10:21:55 +03:00
Alexander Udalov
1daeebcdd3
Minor, add regression test
...
#KT-42562
2020-10-12 21:37:37 +02:00
pyos
1663619606
JVM_IR: add local delegated property metadata to non-synthetic classes
...
Otherwise kotlin-reflect won't find it (and it won't even be serialized
anyway).
#KT-42562 Fixed
2020-10-12 21:14:00 +02:00
Ilmir Usmanov
3b5706972e
Extract effect from lambda argument if it is in parentheses
...
Otherwise, contracts on the parameter have no effect.
#KT-42044 Fixed
#KT-26229 Fixed
2020-10-12 20:16:19 +02:00
Dmitry Petrov
df64bb3eb7
JVM_IR emulate JVM hack for generic signatures in KT-18189
...
KT-40307
See also KT-42609
2020-10-12 21:14:48 +03:00
Alexander Udalov
ac39e4d89c
Minor, add regression test
...
#KT-42554
2020-10-09 22:11:37 +02:00
pyos
e6c0575d3a
JVM_IR: do not deep-copy suspend lambdas in initializers
...
This loses reflection metadata (and also sometimes fails). Which was
missing anyway - this is also fixed now.
#KT-42554 Fixed
2020-10-09 22:11:00 +02:00
Mark Punzalan
8bc7370b92
ForLoopsLowering: Add PLUSEQ origin to increment to use IINC
...
instructions if possible.
2020-10-09 21:34:56 +02:00
Mark Punzalan
ccbf7cc2ee
ForLoopsLowering: Use last-exclusive for-loops for optimized until
...
progressions instead of decrementing "last".
#KT-41352 Fixed
2020-10-09 21:34:56 +02:00
Mark Punzalan
a093efde11
Add blackbox test for KT-42533.
2020-10-09 21:34:56 +02:00
Ilmir Usmanov
375d92cf67
Merge two consequent records in LVT
...
Otherwise, atomicfu will be unable to transform atomic variable usages.
2020-10-09 18:36:37 +02:00
Dmitry Petrov
91b8e32d43
Add ABI tests for classes extending Number and CharSequence
2020-10-09 16:36:35 +03:00
Dmitry Petrov
a412596d8e
JVM_IR emulate old back-end behavior in special bridges + inline classes
...
KT-42491 KT-42539
2020-10-09 16:06:08 +03:00
Mads Ager
afd710292a
[JVM_IR] Fix mangling of default argument stubs for internal methods.
...
The MethodSignatureMapper expected to be able to look at the body
of the default argument stub. That is of course not possible when
it is from an external dependency.
Instead, we go through the attribute owner to get to the method
the stub is a default argument adapter for.
2020-10-08 17:43:24 +02:00
Victor Petukhov
2685c7efce
Jspecify: Rename codeanalysis annotations to jspecify ones
2020-10-08 14:00:10 +03:00
Denis Zharkov
f3a490ee16
Support compiler flag -Xcodeanalysis-annotations
2020-10-08 14:00:09 +03:00
Denis Zharkov
90a9ca6cb3
Minor. Rename flag in JvmAnalysisFlags: jsr305 -> javaTypeEnhancementState
2020-10-08 14:00:08 +03:00
Denis Zharkov
6c37574fce
Rename Jsr305State -> JavaTypeEnhancementState
...
Also, rename some of the properties
It's needed to store status for codeanalysis annotation in that class
2020-10-08 14:00:08 +03:00
Alexander Udalov
2f003bdcb5
Minor, add regression test
...
#KT-42527
2020-10-07 21:31:43 +02:00
pyos
dd1682510f
JVM_IR: generate accessors for inherited abstract members too
...
#KT-41468 Fixed
2020-10-07 21:23:18 +02:00
pyos
98088f739d
PSI2IR: do not generate when subjects multiple times
...
`in x` is represented as `<subject expression> in x` in psi, so
generating the entire call and then replacing the argument with a read
of a temporary results in redundant regenerations of the subject.
#KT-42054 Fixed
#KT-42455 Fixed
2020-10-07 17:22:25 +03:00