Commit Graph

39505 Commits

Author SHA1 Message Date
Ivan Kochurkin e9b9322672 [FIR] Track inc and dec operator calls in preliminary loop visitor, ^KT-44879 Fixed 2022-04-05 15:50:46 +00:00
Ivan Kochurkin fc77d0d26b [FIR] Fix false positive errors for members with explicit API mode, ^KT-51758 Fixed 2022-04-05 15:50:45 +00:00
Ivan Kochurkin 1eefca4259 [FIR] Fix dependencies duplication 2022-04-05 15:50:44 +00:00
Ivan Kochurkin 48dbb9ceb9 [FIR] Fix resolving of refs with implicit this in lambdas in smartcasts 2022-04-05 15:50:43 +00:00
Ivan Kochurkin c6f52893fb [FIR] Fix inconsistent RETURN_TYPE_MISMATCH and TYPE_MISMATCH reporting on functions and properties
^KT-51203 Fixed
2022-04-05 15:50:43 +00:00
Ivan Kochurkin 4617615fd9 [FIR] Fix false-positive INAPPLICABLE_LATEINIT_MODIFIER for property with unresolved type
^KT-51624 Fixed
2022-04-05 15:50:42 +00:00
Ilya Goncharov e2766e402c rra/ilgonmic/more-tests-for-internal-export
[JS IR] Add single file test

[JS IR] isExportedMember considers only public API

[JS IR] Add case with non default accessor

Merge-request: KT-MR-6008
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-50504 fixed
2022-04-05 15:45:41 +00:00
Ilya Goncharov 002d62de89 rra/ilgonmic/revert-signatures-changes
[JS IR] Fix line number test

[JS IR] Ignore isInstance repl test

[JS IR] Ignore isInstance repl test

[JS IR] Add test with unsafe variance

Revert "[JS IR] Optimize away upcasts"

This reverts commit 8149189585.

Get rid of duplicated signatures

Revert "[JS IR] Consider erasing type parameters in return type in js signatures"

This reverts commit 6adcbe081e.

Revert "rra/ilgonmic/exported-bridges-2 [JS IR] Use js name for signature"

This reverts commit 00289d35

[JS IR] Leave as is

[JS IR] Add test with overloading by generic

[JS IR] Add test from master

[JS IR] Add tests from master

Merge-request: KT-MR-5987
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>

^KT-51700 fixed
^KT-51523 fixed
^KT-51685 fixed
2022-04-05 15:35:12 +00:00
Alexander Udalov df86290083 Add another test for KT-49715 and fix JS IR behavior
#KT-49715
 #KT-51798 Fixed
2022-04-05 01:06:57 +02:00
Xin Wang 24105139ea Handle methods descriptor clash in data class
1. Extension functions declared in data classes are generated earlier by `generateMembersDeclaredInClassBody`
2. Extension functions fake override from parent class are generated earlier by `generateFakeOverrideMemberDeclarations`

So it is safe to filter out extension functions inside `generateAdditionalMembersForDataClass`

 #KT-49715
 #KT-51798
2022-04-05 01:06:57 +02:00
Alexander Korepanov 9952d43252 [JS IR] IC improvements
- Reuse a built fragment
  - Use cache for saving built JS code
2022-04-04 17:42:04 +00:00
Dmitriy Novozhilov 5a3b397552 [FIR] Get rid of FirTypedDeclaration
`FirTypedDeclaration` has only one inheritor (`FirCallableDeclaration`),
  so there is no much sense to keep this class
2022-04-04 15:23:58 +00:00
Dmitriy Novozhilov ae0ce57b2c [FIR] Don't force calculation of return type of overrides during status resolution 2022-04-04 15:23:57 +00:00
Dmitriy Novozhilov effa3f197a [FIR] Move ReturnTypeCalculator to :fir:providers module
Also make it an abstract class and turn ReturnTypeCalculatorForFullBodyResolve
  into object (because it has no state and there is no need to create
  different instances of it)
2022-04-04 15:23:56 +00:00
Dmitriy Novozhilov ff1e2c05bf [FIR] Fix declaration specificity rules
Handle visibility of declarations and setters of properties
2022-04-04 15:23:56 +00:00
Dmitriy Novozhilov caffe36181 [FIR] Move utilities for matching overrides into separate session component 2022-04-04 15:23:55 +00:00
Dmitriy Novozhilov 0025d170d1 [FIR] Reorganize processing of candidates in MemberScopeTowerLevel
First collect all candidates and only then consume them. This is needed
  for further handling of overridable candidates from smartcasts
2022-04-04 15:23:54 +00:00
Ilya Chernikov 35f80c04ca IR Scripting: update capturing logic for the REPL, imported scripts,
as well as all other implicit receivers.
2022-04-04 14:55:53 +00:00
Mikhail Glukhikh 6bb24e0153 Delay ForbidUsingExtensionPropertyTypeParameterInDelegate bugfix to 1.8
Related to KT-24643
2022-04-04 13:27:51 +00:00
Mikhail Glukhikh 0ef32e5807 Don't create substituted copy of invoke descriptor with unchanged names
#KT-34919 Fixed
2022-04-04 13:08:28 +00:00
Mikhail Glukhikh 04e8e1b2ad Move file annotation resolve a bit earlier #KT-51499 Fixed 2022-04-04 12:51:34 +00:00
Mikhail Glukhikh 899dc401c8 Add test for KT-51499 (occurs in FE10, already fixed in FIR) 2022-04-04 12:51:33 +00:00
Alexander Udalov 9c78d57de2 Configure SAXParserFactory to avoid XXE references
#KT-51519 Fixed
2022-04-03 00:49:21 +02:00
Mikhail Glukhikh d01e6b61a3 FIR: don't report PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED in exp.cl.
#KT-51761 Fixed
2022-04-01 16:15:53 +03:00
Mikhail Glukhikh aaebb7a30e FIR: don't create delegated constructor call in expect
#KT-51756 Fixed
2022-04-01 16:15:53 +03:00
Dmitriy Novozhilov 6722ec1dad Fix typo 2022-04-01 10:14:58 +04:00
Pavel Kunyavskiy 4873f18067 [K/N] Enable definitely not null cast test for native 2022-03-31 09:02:14 +00:00
Ilmir Usmanov 7579be6c68 Generate CHECKCAST after ACONST_NULL in coroutines
If we do not do this, the state-machine builder will not know the type
of the ACONST_NULL, defaulting to Object, leading to VerifyError.
Alternatively, we could use LVT to deduce the type, but getting types
from LVT is something I got rid of long time ago, and I have no desire
to return it back.

Generating CHECKCAST hints the state-machine builder the type of the
variable avoiding the issue of VerifyError. However, this CHECKCAST
replaces StrictBasicValue.NULL_VALUE with BasicValue in
OptimizationBasicInterpreter. To preserve optimization on not-spilling
known nulls, introduce BasicValues, which represent typed nulls and
create BasicInterpreter, which is aware of them. This way we have the
best of two worlds - we do not spill known nulls, and we know the type
of ACONST_NULL.

 #KT-51718 Fixed
2022-03-30 14:27:29 +00:00
Ilya Chernikov 5d6e2b57a7 Sort sealed class inheritors to ensure reproducible builds with IC
without this sorting the inheritors field in the metadata may depend on
whether some inheritors are compiled in the IC round or not.
2022-03-30 08:35:30 +00:00
Ilya Chernikov 53bc593062 Fix interpreter tests after changing offset calculation 2022-03-30 08:35:21 +00:00
Ilya Chernikov 738c1f34df FIR2IR: Fix offsets calculation for qualified expressions 2022-03-30 08:35:13 +00:00
Ilya Chernikov a65c102469 FIR LT: fix modality for default accessors in LT converter 2022-03-30 08:35:06 +00:00
Ilya Chernikov b3f9e7d361 FIR LT: "fix" tree compare tests by ignoring diagnostic in error types 2022-03-30 08:34:59 +00:00
Ilya Chernikov c4a29651b0 FIR IC: fix test with behavior different from non-tight cycle variants 2022-03-30 08:34:51 +00:00
Ilya Chernikov f2ddac3ece IC: Adopt IC compilation for case then runCompiler adds some dirty files
as it is the case for Fir IC compilation.
2022-03-30 08:34:44 +00:00
Ilya Chernikov 27a3c77174 Temporary restore generation state and related PSI-based APIs
Changes required on IDE plugin side before applying API changes.
2022-03-30 08:34:36 +00:00
Ilya Chernikov 03cbfea737 FIR LT: Introduce source file abstraction, carry it from parsing to IR
along with source lines mapping, allows to "emulate" usage of the
PSI files which allows to extract source file and line mapping info
on every stage from source element.
It makes sense to use this mapping for the error reporting too.
2022-03-30 08:34:30 +00:00
Ilya Chernikov bd60d4b2a6 FIR LT: Add box inline tests for FIR + LT (failing on SMAP so far) 2022-03-30 08:34:21 +00:00
Ilya Chernikov ae10346d75 Refactor FIR diagnostics: cleanup and extract position finder
for reusing the latter in the inliner for LT-based sources
2022-03-30 08:34:13 +00:00
Ilya Chernikov 25e9de286d Test infra: adapt blackbox test runner to work with non-psi sources 2022-03-30 08:34:06 +00:00
Ilya Chernikov 2044754628 Backend: remove psi files from generation state
pass them explicitly to all destinations. This is a step in attempt to
abstract dependencies on PSI in the GenerationState and related places.
2022-03-30 08:33:59 +00:00
Ilya Chernikov da41fddabb Backend: remove codegen factory from generation state
use it explicitly. This is a step in attempt to abstract dependencies
on PSI in the GenerationState and related places.
2022-03-30 08:33:51 +00:00
Ilya Chernikov 018782f0c7 FIR CLI: use VFS for LT files loading
may improve performance in some cases and is consistent with handling
of PSI files
2022-03-30 08:33:43 +00:00
Ilya Chernikov 506152020d FIR: fix LT conversion of imports with backticks 2022-03-30 08:33:35 +00:00
Ilya Chernikov a08e70ae5c FIR CLI: fix java sources search scope usage 2022-03-30 08:33:27 +00:00
Ilya Chernikov 0df3fde37f FIR: implement computeOrigin for IR without accessing sources
fixes LT compilation too
2022-03-30 08:33:18 +00:00
Ilya Chernikov 973273c6c6 FIR CLI: count lines/files and report events to perfman 2022-03-30 08:33:11 +00:00
Ilya Chernikov 090a451902 FIR: implement proper exit on errors in new cli pipeline 2022-03-30 08:33:03 +00:00
Ilya Chernikov f89765eb33 Make JDK classpath roots configuration explicit...
instead of relying on the "configuration files" parameter.
(in the process of migration from KotlinCoreEnvironment).
2022-03-30 08:32:56 +00:00
Ilya Chernikov 806bf8a735 IR [minor]: do not assume that ktfile is always accessible 2022-03-30 08:32:40 +00:00