Commit Graph

17728 Commits

Author SHA1 Message Date
Nikolay Lunyak b46d4e5399 [FIR] Check classes for EXPECTED_PRIVATE_DECLARATION 2023-07-10 09:28:54 +00:00
Nikolay Lunyak 884cd6c754 [FIR] Move FirReturnsImpliesAnalyzer to the extended checkers 2023-07-10 09:28:54 +00:00
Igor Yakovlev b5eafb9eb7 [Wasm] WasmExport implementation 2023-07-07 20:45:51 +00:00
Igor Yakovlev 750653e4b3 [Wasm] Add kotlin wasm wasi mode compiler flag 2023-07-07 15:23:18 +00:00
Brian Norman 61acd2b6f5 [FIR] Do not allow context receivers on value classes
#KT-59413 Fixed
2023-07-07 11:41:59 +00:00
Pavel Mikhailovskii 083f54aceb [KAPT4] Create basic infrastructure for KAPT4 2023-07-07 11:09:16 +00:00
Dmitriy Novozhilov fc57f48c8f [FIR] Union CFG edges from postponed lambdas only if outer call was analyzed independently
Before this change nodes unification was called if outer call was
  completed in the FULL mode, but it may happen even if this call is
  actually a part of some other outer call
2023-07-07 06:45:20 +00:00
Mikhail Glukhikh 15b070b494 K2: don't resolve callable reference to enum entries #KT-59611 Fixed 2023-07-06 15:06:31 +00:00
Dmitriy Dolovov 8aacdb471b [K/N] Fix: Ignore bridge functions in FunctionReferenceLowering
^KT-59858
2023-07-06 12:39:46 +00:00
Ivan Kylchik d3d28783c5 [IR] Support const optimizations for JS backend 2023-07-06 11:00:14 +00:00
Ilya Chernikov b1b1eab35b K2 Scripting: fix testdata for scripts diagnostics tests 2023-07-05 19:46:04 +00:00
Ilya Chernikov 5e3f7184d1 IR Scripting: fix capturing of the script parameter in a fun 2023-07-05 19:46:04 +00:00
Ilya Chernikov bf3a6f7678 K2 Scripting: support script top-level destructuring declarations 2023-07-05 19:46:04 +00:00
Ilya Chernikov 02e2438d37 K2 Scripting: fix script this receiver handling in IR
also fix accessor lowering
2023-07-05 19:46:04 +00:00
Ilya Chernikov 07df03dbec K2 Scripting: fix capturing in scripts created from Fir 2023-07-05 19:46:04 +00:00
Ilya Chernikov 00211a5fc9 K2 Scripting: turn on implicit body resolve for scripts 2023-07-05 19:46:04 +00:00
Ilya Chernikov 1a735b0842 K2 scripting: support script-level typealiases 2023-07-05 19:46:04 +00:00
Ilya Chernikov 70d2fcd9c4 K2 Scripting: deprecate top level script inner classes
no LT support yet
2023-07-05 19:46:03 +00:00
Ilya Chernikov 7484ccb9ee K2 Scripting: allow script top level inline functions 2023-07-05 19:46:03 +00:00
Ilya Chernikov 86b3e65d19 K2 Scripting: enable script processing in diagnostics collector
and add scripts to containing decls in checker context te be able to
check for containing script in checkers
2023-07-05 19:46:03 +00:00
Ilya Chernikov f79f715590 Fir2Ir: remove error reporting on no receiver
this error is not valid for scripts, where some receivers are set
later in the lowering, and it looks like in other cases this problem
will be detected later in lowering or codegen anyway.
2023-07-05 19:46:03 +00:00
Ilya Chernikov 7866c63e49 Fir2Ir: add fake overrides binding for script top level classes 2023-07-05 19:46:03 +00:00
Ilya Chernikov 9adf24950a Fir2Ir scripts: fix declarations registration and processing 2023-07-05 19:46:03 +00:00
Ilya Chernikov 5824b9c59c K2 Scripting: add Fir script codegen tests
27 failing tests are muted
2023-07-05 19:46:03 +00:00
Dmitriy Novozhilov 6bb7fc05df [IR] Split implementation of DataClassMembersGenerator to IR based and descriptor based 2023-07-05 14:57:55 +00:00
Ivan Kylchik d557bcaba4 [IR] Forbid unconditional interpretation of IrGetObjectValue
Earlier we always allowed to interpret `IrGetObjectValue` because
this value is used in const val getter. But now we do a special
check for such getter avoiding visit of `IrGetObjectValue` node.

#KT-59775 Fixed
2023-07-05 13:33:41 +00:00
Kirill Rakhman 04f16d75d2 [K2 MPP] Fix hasStableParameterNames check for fake overrides
This fixes a false positive error regarding different
parameter names in expect actual matching with fake overrides.

#KT-59737 Fixed
2023-07-05 13:30:01 +00:00
Kirill Rakhman b68962018c [FIR] Remove incompatible from expect actual matching if compatible exists
This fixes an issue with checking for default values in call resolution
(see FirDefaultParametersResolver) where it is expected that the map
only contains a single compatible entry.

#KT-59613 Fixed
2023-07-05 08:51:01 +00:00
Ilya Goncharov 148d8c9246 [Gradle, JS] Migrate JS cli tests to ir backend 2023-07-05 07:10:06 +00:00
Dmitriy Novozhilov 38533977f0 [Test] Add test for KT-35314 2023-07-05 06:56:15 +00:00
Dmitriy Novozhilov 5d6328a706 [Test] Add test for KT-53460 2023-07-05 06:56:15 +00:00
Dmitriy Novozhilov 31d046e8cd [Test] Add test for KT-40851 2023-07-05 06:56:15 +00:00
Dmitriy Novozhilov eb041d5d6d [Test] Add test for KT-42995 2023-07-05 06:56:14 +00:00
Dmitriy Novozhilov a35b3bfd17 [Test] Add test for KT-41198 and KT-59860 2023-07-05 06:56:13 +00:00
Dmitriy Novozhilov 2ad441f6c8 [Test] Add test for KT-47494 2023-07-05 06:56:13 +00:00
Dmitriy Novozhilov 03973419dd [Test] Add test for KT-47892 2023-07-05 06:56:12 +00:00
Dmitriy Novozhilov 637b46cb6e [Test] Add test for KT-48115 2023-07-05 06:56:12 +00:00
Dmitriy Novozhilov ca25610756 [Test] Add test for KT-47567 2023-07-05 06:56:11 +00:00
Ilya Goncharov cb5b26d2e7 [JS] Fix diagnostics test data with IR compiler 2023-07-04 18:04:14 +00:00
Kirill Rakhman e7c213e06e [FIR] Report separate error for delegated constructor call to interface
#KT-59216 Fixed
2023-07-04 16:00:45 +00:00
Kirill Rakhman 5abab2197b [FIR] Adapt positioning of NO_VALUE_FOR_PARAMETER to match K1 2023-07-04 16:00:45 +00:00
Kirill Rakhman 6d1d6e48c1 [FIR] Rename qualifiedAccessOrAssignmentsOrAnnotationCalls to callsOrAssignments and add delegated constructor calls 2023-07-04 16:00:45 +00:00
Dmitrii Gridin 09ca335b7e [FIR] CFG: drop redundant edges
Edges from class to its functions and nested classes are redundant
and lead to extra resolution work in lazy resolve mode

^KT-59600 Fixed
2023-07-04 12:07:04 +00:00
Dmitrii Gridin 050c66ea81 [FIR] add missing Any super type to Cloneable
^KTIJ-24272 Fixed
2023-07-04 10:20:37 +00:00
Denis.Zharkov 01354c8ce5 K2: Fix false-positive resolution to j.l.String constructor
In K1 (see LazyImportScope), default start import with different
priority worked as follows:
- if something is found in HIGH, don't look at LOW
- otherwise, look at LOW

That, in particular, helped to avoid looking into JDK mirroring classes'
constructors like when resolving calls like String(...) because we
just don't look into j.l.String while already found kotlin.String

The change inside FirTowerResolveTask.kt is not made accidentally:
- At first, it's more or less obviously a bug fix because tower group
for hide-members candidate with implicit receiver should take into
account the tower level of the receiver itself.
- The change is attached to this commit because otherwise the test
at compiler/testData/diagnostics/testsWithStdLib/kt55503.kt starts
failing.
The bug was hidden because previously after finding a successful
`Sequence.forEach` candidate for the inner receiver
(at the default HIGH star import scope), resolver was continuing to
look into default LOW star import scope where it's frozen forever because
we had the better/closer candidate anyway.

But after this change with merging default star imports into the same
tower leve, resolver was continuing its job, enumerating implicit
receivers, finding List<Int> there and noticing that there's
a TopPrioritized hide-member candidates for them
(erroneously ignoring it has a worse/more far receiver).

^KT-51670 Fixed
2023-07-04 07:25:22 +00:00
Denis.Zharkov 12dcfd25e6 K2: Fix test state for KT-51670 before the fix 2023-07-04 07:25:22 +00:00
vladislav.grechko 195ca10394 [FIR] Report error on non-public API access in @PublishedApi inline fun
^KT-59695: Fixed
2023-07-03 12:24:16 +00:00
Kirill Rakhman c7ae3c75db [FIR] Don't require delegated constructor calls for expect constructors
#KT-59640 Fixed
2023-07-03 10:17:22 +00:00
Kirill Rakhman 028921ade1 [FIR] Implement checker for value parameter default value type mismatch
#KT-58901 Fixed
2023-07-03 10:11:36 +00:00
Denis.Zharkov 3279313f2c K2: Fix priority for implicit receiver + extensionInvoke
See K1 counterpart at org.jetbrains.kotlin.resolve.calls.tower.TowerResolver.Task.processImplicitReceiver

^KT-58943 Fixed
^KT-59541 Fixed
2023-07-01 16:29:06 +00:00