Commit Graph

15426 Commits

Author SHA1 Message Date
Simon Ogorodnik 9f6a812786 Fix multiple registration of same type variable in builder inference 2022-03-18 12:14:00 +00:00
Alexander Udalov ae2c4753df Fix incorrect test data on KCallable.call for inline classes 2022-03-18 12:29:05 +01:00
Alexander Udalov 8b56babb1d Fix type mapping of nullable inline class types in reflection
Based on #4761.

 #KT-31141 Fixed

Co-authored-by: wrongwrong <boranti1995@gmail.com>
2022-03-18 12:29:05 +01:00
Alexander Udalov 07ebf4ed29 Do not suppress errors with -Xsuppress-version-warnings
#KT-48833 Fixed
2022-03-18 12:28:28 +01:00
wrongwrong a1b6c9f546 Fixed a bug where DEFAULT_CONSTRUCTOR_MARKER appeared twice as an argument
#KT-27598 Fixed

Co-authored-by: Alexander Udalov <alexander.udalov@jetbrains.com>
2022-03-17 00:54:09 +01:00
Mikhail Glukhikh 87a7408ddf FIR: handle double-imported qualifiers properly 2022-03-15 13:21:02 +00:00
Mikhail Glukhikh b038ae8b0c FIR: handle double-imported constructors properly 2022-03-15 13:21:01 +00:00
Mikhail Glukhikh 0a7da903f4 FE1.0/FIR: add test for "double import" situation 2022-03-15 13:21:00 +00:00
Mikhail Glukhikh 5810ac01d2 FE1.0/FIR: slightly fix diagnostic messages about OptIn 2022-03-15 13:08:19 +00:00
Alexander Korepanov 69295f2cf0 [JS IR] IC invalidation refactoring
- Huge refactoring for IC
  - Update hash combination logic
  - Introduce value class for IC hashes
  - Calc md5 directly by function IR
  - Split IC logic by classes
  - Move JsIrLinkerLoader into separate file
  - CacheUpdateStatus is a sealed class
  - Render TYPE_PARAMETER reified flag

^KT-51081 Fixed
^KT-51084 Fixed
2022-03-15 05:34:19 +00:00
Yan Zhulanow fa4dadf9b7 Update KotlinClassInnerStuffCache implementation
'KotlinClassInnerStuffCache' was copy-pasted from the platform's
'ClassInnerStuffCache' several years ago. After J2K and other changes,
it became quite dirty.

Besides cleaning things up, enum synthetic method handling have
significantly improved. Before, such methods were handled only in
'processDeclarationsInEnum', and 'getMethods()' didn't return them.
This led to inconsistent behavior and was reason for providing special
ad-hoc support in '1b6ded600518176b21cc308ed3e032ef8d04cc90'.
2022-03-14 17:53:55 +09:00
Yan Zhulanow f237631f05 Revert "FIR/LC: create synthetic members of enum class"
This reverts commit 1b6ded60
2022-03-14 17:53:55 +09:00
Mikhael Bogdanov 6b00b51e6d Generate fake variables for default lambdas during inline
#KT-51557 Fixed
2022-03-14 08:48:26 +00:00
Xin Wang 4277827506 Don't transform irBranch if tableswitch can't be generated
#KT-34466 Fixed
2022-03-12 14:30:00 +03:00
Dmitriy Novozhilov 6f64aedaf0 [FIR] Fix FindReferencePositioningStrategy for light tree
There was a problem which causes to lookup for assign token inside
  functions from arguments of call
2022-03-11 15:36:05 +03:00
Dmitriy Novozhilov ade2307345 [FIR] Fix exponential analysis of augmented array access calls
^KT-50861 Fixed
2022-03-11 15:36:05 +03:00
wrongwrong c4735f9f29 Add tests for KFunction involving value classes
See KT-31141.
2022-03-10 23:28:40 +01:00
Mikhail Glukhikh c8453ec8b4 FIR: report ambiguity-like errors in type resolve 2022-03-10 20:42:42 +00:00
Simon Ogorodnik 4ba5a55626 FIR. Add visibility/deprecation filtering to type resolve 2022-03-10 20:42:39 +00:00
Mikhail Glukhikh 779aa75855 Make FE1.0/FIR OptIn override message more clear 2022-03-10 09:09:51 +00:00
Mikhail Glukhikh d823020c07 Make FIR/FE1.0 report similar OptIn messages 2022-03-10 09:09:50 +00:00
Mikhail Glukhikh b42c236fb3 Replace blank messages in OptIn diagnostics #KT-51358 Fixed 2022-03-10 09:09:50 +00:00
Mikhail Glukhikh 4178c8156a Fix NPE in KtSourceElement.elementType #KT-44152 Fixed 2022-03-10 09:01:58 +00:00
Mikhail Glukhikh 8c7a8edb75 Minor: add diag.txt file for label clashes diagnostic tests 2022-03-09 15:19:28 +00:00
Mikhail Glukhikh 14eec6cfc0 FE 1.0: implement typed this label resolve warning for KT-51433
#KT-51433 Fixed
2022-03-09 15:19:27 +00:00
Mikhail Glukhikh b5e2c492c6 FE 1.0: implement initial label resolve warning for KT-51433 2022-03-09 15:19:26 +00:00
Alexander Udalov 1e26888dd9 Psi2ir: fix parameter indices when generating extension invoke call
Incorrect `valueParameter` was passed to `generateValueArgument`, which
resulted in incorrect type being considered for generating suspend
conversion.

 #KT-50949 Fixed
2022-03-09 15:19:38 +01:00
Alexander Udalov f7f64be269 Remove unneeded .txt dumps in codegen box tests
These are only used in diagnostic tests, and for codegen tests they are
basically useless.
2022-03-08 14:19:37 +01:00
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
Mikhail Glukhikh ebed224f82 FE 1.0: use TYPE_VARIANCE_CONFLICT deprecation factory 2022-03-03 12:57:04 +00:00
Mikhail Glukhikh 7781413a93 FE 1.0: report TYPE_VARIANCE_CONFLICT also on qualifier type arguments
#KT-51439 Fixed
2022-03-03 12:57:04 +00: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
Ilya Kirillov 4a5aee688e FIR LC: fix invalid type param upper bound 2022-02-25 14:06:05 +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
Jinseong Jeon 1b6ded6005 FIR/LC: create synthetic members of enum class
^KTIJ-17414 In Progress
^KTIJ-17444 In Progress
2022-02-24 17:51:50 +01: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
Ivan Kochurkin f751f13c4d [FIR] Fix incompatible KClass<Any> and callable reference Collection::class, ^KT-51272 Fixed 2022-02-23 14:21:59 +03:00
Ivan Kochurkin 31d9313c51 [FIR] Fix "Expected some types" exception, ^KT-51274 Fixed 2022-02-23 14:21:59 +03:00
Ivan Kochurkin 6a3b7a9f91 [FIR] Ignore fake functions in FirExposedVisibilityDeclarationChecker ^KT-51229 Fixed 2022-02-23 14:21:58 +03:00
Ivan Kochurkin 73b45a1254 [FIR] Report UNSUPPORTED on array literals not from annotation classes ^KT-50750 Fixed 2022-02-23 14:21:57 +03:00