Commit Graph

105223 Commits

Author SHA1 Message Date
Ivan Kylchik 6d57cbe23c [JVM] Reorganize positions of methods in FastAnalyzer 2023-10-12 13:04:43 +00:00
Ivan Kylchik 895afc736d [JVM] Drop I : Interpreter<V> type parameter from FastAnalyzer 2023-10-12 13:04:43 +00:00
Ivan Kylchik 87c46db3d5 [JVM] Drop getFrame and setFrame methods from FastAnalyzer 2023-10-12 13:04:43 +00:00
Ivan Kylchik f7f253d2bf [JVM] Move isTcbStart computation in FastAnalyzer 2023-10-12 13:04:43 +00:00
Ivan Kylchik 53d9b3c54f [JVM] Combine all mergeControlFlowEdge methods
This is just a refactoring commit. All fast analyzers are doing the
same thing in `mergeControlFlowEdge`, so we extract it in common
`FastAnalyzer`. The only exception is `FastStackAnalyzer`.
There was no `isMergeNode` check, but this is an optimization
that allows us to reuse a frame and not copy it.
2023-10-12 13:04:42 +00:00
Ivan Kylchik 68e4a7a318 [JVM] Combine all analyzeInstruction methods 2023-10-12 13:04:42 +00:00
Ivan Kylchik 58473b94a7 [JVM] Reuse visitNopInsn method in all Fast...Analyzer classes 2023-10-12 13:04:42 +00:00
Ivan Kylchik ed95ebc585 [JVM] Move visit...Insn methods in FastAnalyzer
They are actually the same.
2023-10-12 13:04:42 +00:00
Ivan Kylchik 7845e6bb0a [JVM] Drop visitControlFlowExceptionEdge method from FastStackAnalyzer
There is no class that overrides this method.

Also replaced `newValue` call with `newExceptionValue`. Under the hood,
`newExceptionValue` still calls `newValue` if the interpreter doesn't
redefine it. And it kind of makes sense to call `newExceptionValue`
here because we are handling try-catch block.
2023-10-12 13:04:42 +00:00
Ivan Kylchik e9019e9fb3 [JVM] Drop StoreLoadInterpreter class 2023-10-12 13:04:42 +00:00
Ivan Kylchik 364faa9506 [JVM] Drop StoreLoadValue interface 2023-10-12 13:04:42 +00:00
Roman Efremov a05b37c652 [K2] Support reporting of SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS
...on regular classes and enum entries.

^KT-59979 Fixed
2023-10-12 13:01:40 +00:00
Roman Efremov 32a87836c2 [Test] Improve test of SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS diagnostic
Add case where explicit primary constructor is present in expect,
so that SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR is not
reported.

^KT-59979
2023-10-12 13:01:40 +00:00
Simon Ogorodnik 13b6653899 [FIR] Add todo to remove violation of lookup tag contract 2023-10-12 12:27:54 +00:00
Simon Ogorodnik 024e94a479 [K2] Document KMP implementation in the K2 Compiler
Add comprehensive documentation explaining the implementation and
functions of the Kotlin multiplatform (KMP) support in the K2 Compiler.
2023-10-12 12:27:54 +00:00
Sergej Jaskiewicz 04c0cc5a5c [FIR generator] In properties always print get() ... on new line
This is to unify the code formatting with IR classes.
2023-10-12 11:45:55 +00:00
Sergej Jaskiewicz 4507615c69 [FIR generator] Print accept method's body on new line
This is to unify the code formatting with IR classes
2023-10-12 11:45:55 +00:00
Sergej Jaskiewicz 04ac4b71a3 [FIR generator] Replace AbstractElement with ElemenOrRef
In the FIR generator, the `AbstractElement` class was used to
represent either an element type without type arguments applied
(using the `Element` subclass), or an element type with applied type
arguments (using the `ElementWithArguments` subclass).

Instead, it is more logical to use the `Element` class to always
represent a non-parameterized element type, and for a parameterized
element type use the `ElementRef` class, just like we do
in the IR generator.
2023-10-12 11:36:20 +00:00
Ilya Kirillov 86c8f3cc35 Remove obsolete @OptIn(ExperimentalUnsignedTypes::class) annotations
^KT-62510
2023-10-12 10:41:00 +00:00
Ilya Kirillov f11cb277cd Remove obsolete @OptIn(ExperimentalStdlibApi::class) annotations
They were added when `buildList`, `buildMap` and `buildSet` were experimental.

^KT-62510
2023-10-12 10:41:00 +00:00
Ilya Goncharov 376d27dc6a [Gradle, Wasm] Fix proxy for karma wasm tests on windows
^KT-62128 fixed
2023-10-12 09:27:34 +00:00
Anastasia.Nekrasova 4c9ad970ff [K2] Violation of OPT_IN_USAGE_ERROR non-propagating opt-in rules for typealias
^KT-62451
2023-10-12 09:03:39 +00:00
Anastasia.Nekrasova 6d446abe12 [K2] Disappeared OPT_IN_USAGE_ERROR for typealias
^KT-62451
2023-10-12 09:03:39 +00:00
Nikolay Lunyak 54285736d0 [FIR] Don't miss diagnostics passed to @Suppress as names = []
In these cases we have a `FirVarargArgumentsExpression`
with a `FirNamedArgumentExpression` inside as its first
argument, which, in turn, has a `FirArrayLiteral`
argument.

^KT-62146 Fixed
2023-10-12 08:56:12 +00:00
Nikolay Lunyak 598b5dbdf4 [FIR] Reproduce KT-62146 2023-10-12 08:56:12 +00:00
Alejandro Serrano Mena 166b99181b [Test] Ensure that properties cannot be used as operators
In some cases the combination of property + invoke was incorrectly allowed

^KT-62349
2023-10-12 08:32:17 +00:00
Sergej Jaskiewicz a909a28f29 [FIR generator] Use more type-safe field builders 2023-10-12 08:24:12 +00:00
Sergej Jaskiewicz 8be455649c [FIR generator] Use TypeVariable instead of TypeArgument for TPs
This is a step towards commonizing the code generator between
FIR and IR: KT-61970
2023-10-12 08:24:12 +00:00
Dmitriy Novozhilov c25cde8871 [FIR2IR] Provide correct module data to FirModuleDescriptor
Properly implement friend modules visibility check

^KT-61384 Fixed
^KT-62475 Fixed
2023-10-12 06:47:02 +00:00
Anastasia.Nekrasova e3bab4a7da [K2] Prohibit smart casts for 'expect' properties
^KT-61340
2023-10-11 17:05:29 +00:00
Roman Efremov e4ea733482 [K2] Support reporting of EXPECTED_ENUM_ENTRY_WITH_BODY
Test for the case when enum entry has constructor call but doesn't have
body already exist in
`compiler/testData/diagnostics/tests/multiplatform/enum/constructorInHeaderEnum.kt`.

^KT-59978 Fixed
2023-10-11 15:04:02 +00:00
Roman Efremov db886a0435 [K2] Make impl classes in SourceNavigator private to prevent
...accidental use of tree-specific implementation instead of common one.
Actually, I stepped on this rake myself in next commit, when
accidentally imported function from `PsiSourceNavigator`.

^KT-59978
2023-10-11 15:04:02 +00:00
Sergej Jaskiewicz 8798fdeb82 [FIR generator] Use TypeRef for denoting types
(instead of `Type` and `Importable`)

This is a step towards commonizing the code generator between
FIR and IR: KT-61970
2023-10-11 11:16:08 +00:00
Vyacheslav Gerasimov 918cf183c1 Build: Use cache-redirector for Node.js downloads
#KTI-1401
2023-10-11 11:13:13 +00:00
Nikolay Lunyak df6f51b49f [FIR] Ignore the operator keyword when checking conflicting overloads
^KT-59880
2023-10-11 08:54:09 +00:00
Nikolay Lunyak 09436d0480 [FIR] Report conflicts for constructors of top-level classes
^KT-59880
2023-10-11 08:54:09 +00:00
Nikolay Lunyak bc2eb546b4 [FIR] Report conflicts for data class generated members
^KT-59880
2023-10-11 08:54:09 +00:00
Nikolay Lunyak afc22728fa [FIR] Don't miss annotations while generating augmented assignments
^KT-62473 Fixed
2023-10-11 08:33:05 +00:00
Nikolay Lunyak 54e9cafc73 [FIR] Reproduce KT-62473 2023-10-11 08:33:05 +00:00
Vladimir Sukharev bae8b283c7 [IR] Normalize temp var names in Kotlin-like dump
^KT-61983 Fixed
2023-10-11 07:49:35 +00:00
Igor Chevdar 6c519488a6 [IR] Reworked K/N variables inliner hint 2023-10-11 06:27:02 +00:00
Igor Chevdar 1b30f76a78 [K/N][tests] Added a test on stepping through inline arguments 2023-10-11 06:27:02 +00:00
Vladimir Sukharev 69d2b94a68 [FIR] Fix Disappeared NULLABLE_TYPE_IN_CLASS_LITERAL_LHS
^KT-59970 Fixed
2023-10-10 18:23:19 +00:00
Vladimir Sukharev 1c395ef0df [FIR-TEST] Remove accidentally committed testfiles 2023-10-10 18:22:41 +00:00
Anna Kozlova 1f4d985b7b [AA] include inferred types in functional exp expected type
Fixed for K2 only, k1 remains as is

^KT-62466 fixed
2023-10-10 14:06:48 +00:00
Ilya Kirillov c32e7c723d [Analysis API] resolve [this] in KDoc to extension receiver
^KT-62407 fixed
2023-10-10 14:03:49 +00:00
Mikhail Glukhikh a5a8f6736b Raw FIR: set source for setter parameter <set-?> access in delegated properties
Related to KT-59864
2023-10-10 13:38:52 +00:00
Mikhail Glukhikh d321fa3fd9 K2: add partial reproduction of KT-59864 2023-10-10 13:38:52 +00:00
Mikhail Glukhikh 162ba59d7f Raw FIR: set source for delegate field references
Related to KT-59864
2023-10-10 13:38:52 +00:00
Mikhail Glukhikh 9d3bf69212 Raw FIR/LT: use similar sources for delegated constructor calls
After this commit all IR source range tests behave in the same way
for FIR/PSI and FIR/LT, test data is now consistent
2023-10-10 13:38:52 +00:00