Commit Graph

7804 Commits

Author SHA1 Message Date
Alexander Udalov 328853dffe Add tests for obsolete issues
(Test for KT-37331 is added to multiplatform/defaultArguments/suspend.kt.)

 #KT-30080
 #KT-33641
 #KT-36237
 #KT-36952
 #KT-37331
 #KT-38920
 #KT-39256
 #KT-42415
 #KT-44636
 #KT-45704
 #KT-47084
 #KT-47894
2022-03-08 14:19:37 +01:00
Ilmir Usmanov 254ada88d1 Minor. Add test with inline class inside inline class's init block 2022-03-04 05:23:23 +03:00
Dmitry Petrov fdb01d96f0 JVM_IR JavaSamConversionEqualsHashCode 2022-03-03 09:01:42 +00:00
Dmitriy Novozhilov 4022918ea2 [FIR2IR] Properly generate arguments for annotation constructors calls in default values of annotation constructors 2022-02-28 11:42:35 +03:00
Alexander Udalov 157db778fd Rework support of Iterator.iterator optimization in ForLoopsLowering
- Fix the predicate used for finding the member function `next`: check
  that there's no extension receiver parameter, don't filter out
  abstract functions.
- Do not copy iterator expression, instead change the type in all
  references to the iterator variable.
- Fix some style issues.

 #KT-47171 Fixed
2022-02-28 01:39:31 +01:00
Xin Wang 1b776bd5b6 JVM_IR: Specialize iterator if possible
fixes KT-47171
2022-02-28 01:39:31 +01:00
Mikhail Glukhikh 53d6ac24e5 Switch kotlin version to 1.7
* Change 1.6 to 1.7 constants
* Fix SAFE_CALL_WILL_CHANGE_NULLABILITY for testData
* Change EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_WARNING to EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR
* Change NON_EXHAUSTIVE_WHEN_STATEMENT to NO_ELSE_IN_WHEN
* Fix testData for SafeCallsAreAlwaysNullable
* Change T -> T & Any in test dumps
* Change INVALID_CHARACTERS_NATIVE_WARNING -> INVALID_CHARACTERS_NATIVE_ERROR
* TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING -> TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR
2022-02-25 11:46:27 +00:00
Dmitry Petrov a1db077af9 JVM_IR KT-51458 fix DNN types handling in JvmStringConcatenationLowering 2022-02-25 10:09:14 +03:00
Igor Yakovlev f0f94623f4 [WASM] Implement data class hashCode and toString for arrays 2022-02-24 20:15:15 +03:00
Alexander Udalov b443848ea0 Fix type table serialization in DescriptorSerializer
Always serialize type table (and version requirement table) after
everything else, to prevent bugs like KT-51446 where inline class
underlying type was added to the type table after it has already been
serialized.

 #KT-51446 Fixed
2022-02-24 16:34:25 +01:00
Alexander Udalov c53d91bae1 JVM IR: adjust generation of linenumber for try-finally
Do not generate linenumber for the start of the finally block, because
that is usually where the only word 'finally' is located. Instead,
generate linenumber for the first expression inside the finally block.

Not generating this linenumber fixes an issue in code coverage tools
which would consider such finally uncovered. Although this might be
technically considered as designed, it makes more sense to NOT detect it
as uncovered because semantics of the finally block shouldn't really
differ whether it's executed normally or because an exception happened.
It's also beneficial for the tool support to behave like javac, which
doesn't generate the linenumber either.

 #KT-50973 Fixed
2022-02-24 16:33:40 +01:00
Igor Chevdar 838743bf07 [box-tests] Ignored test for K/N
It will fail in Kotlin 1.7
2022-02-24 15:20:14 +03:00
Igor Chevdar d51eb32c62 [IR] Fixed IrType.classifierOrNull
Supported IrDefinitelyNotNullType explicitly for now
(later it will be better to handle it at the call sites)

Co-authored-by: Svyatoslav Scherbina <svyatoslav.scherbina@jetbrains.com>
2022-02-24 15:20:13 +03:00
Dmitry Petrov 872b81ac8a JVM prune exception edges in DFA in some cases 2022-02-24 10:06:47 +00:00
Ilmir Usmanov 8811f62300 Fix mapping of nullable generic underlying types of inline classes
#KT-32162 Fixed
2022-02-23 01:23:07 +03:00
Mikhail Glukhikh 981f8b1871 FIR: implement resolve of unqualified enum references in when
See KT-16768
2022-02-22 22:13:06 +03:00
Ilmir Usmanov c072448d22 Lower fun interface children's body during inline class lowering
#KT-51121 Fixed
2022-02-21 19:50:12 +03:00
Alexander Udalov e5e5970883 JVM IR: workaround indirect dependency between lowerings
#KT-51353 Fixed
2022-02-18 17:04:18 +01:00
Dmitriy Novozhilov aeb68f956c [FIR] Turn LEAKED_IN_PLACE_LAMBDA into a warning 2022-02-18 17:44:36 +03:00
Dmitriy Novozhilov 6105271d41 [FIR] Make internal declarations from dependsOn dependent modules visible 2022-02-18 17:44:36 +03:00
Anastasia.Shadrina 4b366ddcf6 [BE JVM] KT-51271 Set proper indices generating contextual inline call
[Tests] Test inline call with context receivers and default params
2022-02-18 15:55:43 +03:00
Anastasia.Shadrina 4bc7b0c366 [BE JVM] KT-51352 Do not mix extension and context receivers in suspends 2022-02-18 13:39:36 +03:00
Ilmir Usmanov 28b60d7e61 Add another flavor to android tests 2022-02-18 08:50:25 +00:00
Ilmir Usmanov 05457c291d Minor. Update test 2022-02-17 09:00:37 +03:00
Ilmir Usmanov f4407c213a Rename some tests with long names
Otherwise, their path on WIN will be longer than MAXPATH, leading to
V8 load error.
2022-02-16 23:46:30 +03:00
Ilmir Usmanov 290a06676d Minor. Ignore tests in JS_IR 2022-02-16 16:12:29 +03:00
Mikhail Glukhikh 76ff717091 FIR2IR: don't create non-lazy fake overrides inside lazy class
This commit allows to calculate member with initial signature properly.
Only lazy IR members are suitable to calculate initial signature.
Before this commit we sometimes built non-lazy children for lazy class.
Now we build lazy children (with an exception of private declarations).
2022-02-16 09:24:12 +00:00
Pavel Punegov 33931bf010 [K/N][test] Ignore test that uses JvmInline 2022-02-15 12:41:25 +03:00
Ilmir Usmanov 714c5091cc Add regression test for KT-51254
#KT-51254 Fixed
2022-02-15 08:11:21 +01:00
Ilmir Usmanov 00a08fc6a4 Minor. Add tests and comment about copying generic parameters to
constructor, but not function reference to the constructor.

 #KT-32162
2022-02-15 08:11:19 +01:00
Ilmir Usmanov 84ccf412cb Minor. Ignore some tests on old JVM, JS_IR, JS and WASM
#KT-32162
2022-02-15 08:11:18 +01:00
Ilmir Usmanov 2fedb97d16 Correctly map nullable generic underlying value of inline class
if upper bound is primitive type.
 #KT-32162
2022-02-15 08:11:17 +01:00
Ilmir Usmanov a7e2f7a6b6 Map nullable type parameter with nullable inline class upper bound
which, in turn, has primitive or nullable underlying type to inline
class.
 #KT-32162
2022-02-15 08:11:15 +01:00
Ilmir Usmanov cece7120df Minor. Add more tests 2022-02-15 08:11:13 +01:00
Ilmir Usmanov c8817893d4 Support default parameters of inline type with generic underlying value
#KT-32162
2022-02-15 08:11:11 +01:00
Ilmir Usmanov 4f95171472 Minor. Add tests 2022-02-15 08:11:10 +01:00
Ilmir Usmanov 909b455758 Support generic underlying type of inline class in FIR
#KT-32162
2022-02-15 08:11:09 +01:00
Ilmir Usmanov 9060168542 Support generic underlying type of inline class
Use upper bound in JVM representation.
 #KT-32162
2022-02-15 08:11:08 +01:00
Denis.Zharkov 58408d8a78 FIR: Fix incorrect qualifier resolution in case of type parameters
^KT-51265 Fixed
2022-02-14 17:16:22 +03:00
Victor Petukhov fd6500c167 [FE 1.0] Set a fixation priority for self type variables less than any of ready for fixation kinds
^KT-51040 Fixed
^KT-49838
2022-02-14 15:43:53 +03:00
Ilmir Usmanov 8f23fc54a4 Mangle bridges if its return type is not inline
#KT-51235 Fixed
2022-02-14 13:06:13 +01:00
Svyatoslav Kuzmich 4636f71076 [Wasm] Loader improvements
- Output ES modules instead of plain files
- Support -Xwasm-launcher=d8 for d8 shell used in tests and benchmarks.
- Reuse launcher generation logic in CLI and box tests runners.
- Create separate output directory for each box since
  there are multiple output files generated for each test.
- Stop using absolute paths in generate JS files
  to simplify running generated code on different machine
- Remove ">>>" from println output


Merge-request: KT-MR-5729
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2022-02-10 22:59:44 +00:00
Vladimir Dolzhenko 918a91dbdf Escape special names with backticks in test data
#KT-51248
2022-02-10 21:20:47 +00:00
Mads Ager c8cade5bf3 [FIR] Ensure qualifier resolution takes place for type aliases.
When resolving a name that is used as a receiver and all
candidates are classifier symbols, we need to perform
qualifier resolution. The code used to only do that for
regular classes, and would not perform qualifier resolution if
there was a type alias candidate.

^KT-51171 Fixed
2022-02-10 16:27:32 +03:00
Ilmir Usmanov 47ee0e5b0a Get type arguments from supertype in supercall
Otherwise, when the function has inline class parameter, we get ICE.
We do not get the error without inline class parameter, since we
substitute type parameters in limited situations, which includes
inline class lowering.

 #KT-51157 Fixed
2022-02-10 10:40:55 +01:00
Dmitriy Novozhilov 0eb526a8b4 [FE 1.0] Report warning about conflict in inherited members from deserialized dependencies
^KT-51194
^KT-51223 Fixed
2022-02-09 19:35:56 +03:00
Svyatoslav Scherbina 62c1bd0044 Native: fix using nested expect enum entry in a default argument
^KT-51156 Fixed
2022-02-09 14:41:11 +00:00
Ivan Kochurkin 5391ee91af [FIR2IR] Fix incorrect type of typealias for suspend functional type, ^KT-50997 Fixed 2022-02-07 17:21:59 +03:00
Ivan Kochurkin 8a8bdc9ff4 [FIR2IR] Fix synthetic property reference in delegate expression 2022-02-07 17:21:58 +03:00
Dmitriy Novozhilov 1591518cf6 [FIR] Support constant unary operators for integer literal operators
^KT-38895
2022-02-07 13:36:37 +03:00