Commit Graph

624 Commits

Author SHA1 Message Date
pyos 31eaa211b7 Add test for KT-54744 2022-11-03 13:33:09 +00:00
Jinseong Jeon 5bca3c6841 AA: rename test api for better clarification
Many sub tests are implementing the same name, doTestByFileStructure,
which indeed are based on the list of KtFile in a single module.
Rather, this one should be named after "ModuleStructure".
2022-11-02 17:38:15 +01:00
Denis.Zharkov 82100a414f FIR: Preserve K1 behavior for rawTypeValue ?: nothingTypedValue
It's been approximated to the non-raw version back then

^KT-54526 Fixed
2022-10-31 14:28:56 +00:00
Denis.Zharkov 52eb535a7d FIR: Use platform specific overridability rules for platform members
^KT-54570 Fixed
2022-10-31 14:28:55 +00:00
Denis.Zharkov 1e368bcd86 FIR: Allow to skip specifying type arguments for members from raw type
^KT-54666 Fixed
^KT-54526 Related
2022-10-31 14:28:54 +00:00
Denis.Zharkov c0e0900344 FIR: Preserve K1 behavior for synthetic properties on raw type
^KT-54502 Fixed
2022-10-31 14:28:53 +00:00
Denis.Zharkov 5cc31114cd FIR: Support special scope for raw types
^KT-46369 Fixed
^KT-41794 Fixed
^KT-49351 Fixed
2022-10-31 14:28:50 +00:00
Pavel Mikhailovskii 1215ae0fe7 KT-1436 Nicer compiler errors when the feature isn't supported 2022-10-31 13:49:57 +00:00
Dmitriy Novozhilov bc9bc26cc8 [Test] Add test for KT-54668 2022-10-27 11:08:56 +00:00
Dmitriy Novozhilov 6bc952adff [Test] Add test for KT-54663 2022-10-27 11:08:56 +00:00
Dmitriy Novozhilov 1927369ae9 [Test] Add test for KT-54662 2022-10-27 11:08:55 +00:00
Mikhail Glukhikh 8e48636b29 K1: don't report assignment TYPE_MISMATCH in BI under feature ON
Related to KT-54004
2022-10-26 09:21:48 +00:00
Mikhail Glukhikh 80fa765333 K1: introduce synthetic assignment checker with deprecation for KT-54305
#KT-54305 Fixed
Related to KT-54309
2022-10-25 12:33:09 +00:00
Mikhail Glukhikh 7bd512fbb3 FE: add test for KT-54305 2022-10-25 12:33:08 +00:00
Ivan Kylchik 5b16b2c71e Properly verify args in string concatenation expression for interpreter
If string concatenation contains object value, then this argument
will not have explicit toString call. We must find and check toString
method manually.

#KT-54615
2022-10-24 13:14:16 +00:00
Mikhail Glukhikh 5347c3c7cc FE: add test for KT-53408 to have stable behavior here 2022-10-20 13:27:04 +02:00
Dmitriy Novozhilov 8fbb605034 [FIR] Rename containingClass function to containingClassLookupTag
Since this function returns lookup tag instead of FirClass or symbol
  the old name may lead to misunderstanding
2022-10-19 11:09:34 +00:00
Dmitriy Novozhilov fa9f0bcf84 [FIR] Ignore CFA-only edges in DFA even if they are dead
^KT-53920 Fixed
2022-10-19 11:09:33 +00:00
Dmitriy Novozhilov 55aae5325c [Test] Add test for KT-54209 2022-10-19 11:09:32 +00:00
Dmitriy Novozhilov 5665139865 [Test] Add test for KT-54125 2022-10-19 11:09:31 +00:00
pyos ee921412fc FIR: intersect return types of declarations in intersection scopes
^KT-54378 Fixed
2022-10-14 08:25:26 +00:00
Ivan Kochurkin 40a01180ff [FIR] Move createSessionWithDependencies and createEmptySession into FirSessionFactoryHelper 2022-10-13 18:11:48 +00:00
vladislav.grechko 817afcd4af KT-MR-7307 review fixes 2022-10-13 15:19:10 +00:00
Denis.Zharkov 31ba1f1534 Add deprecation warning for false-negative TYPE_MISMATCH
See KT-49404 for details

In K1, within SubstitutingScope we approximate almost all the types
containing captured types are being approximated to either a lower or
an upper bound.

While mostly, it's being done correctly there are some problems with
approximations for flexible types

So, the parameter's type of A<in Any>::foo is approximated to Inv<in Any!>,
thus allowing to use Inv<*>, while it's obviously unsound.

NB: For the similar example, in B, there are regular TYPE_MISMATCH
because parameter for B<in Any>::foo is approximated to Nothing

Also, it's important to say that
- in K2 everything works because we don't use type approximation there
- approximation algorithm that works incorrectly is only being used in K1

^KT-54332 Fixed
2022-10-12 20:53:02 +00:00
Mikhail Glukhikh 0940707fd4 FE: add reproducer for KT-54004 2022-10-12 08:21:12 +00:00
Pavel Mikhailovskii f4bdf54601 KT-8575 Fix warnings for Java synthetic properties 2022-10-10 22:03:58 +00:00
vladislav.grechko e0c8142106 Support of custom 'equals' and 'hashCode' in inline classes
'equals' from any made available for overriding in inline classes
'typed' equals made available for definition in inline classes
'typed' equals definition made compulsory if 'untyped' is overridden
'operator' keyword is allowed in 'typed' equals definition

^KT-24874: Fixed
2022-10-10 16:52:34 +00:00
Mikhail Glukhikh d491eba629 K2: add reproducer for KT-54275 2022-10-10 06:20:39 +00:00
Nikolay Lunyak b6f950ed75 [FIR][FE 1.0] KT-47933: Warn about redundant @Repeatable
Merge-request: KT-MR-7318
Merged-by: Nikolay Lunyak <Nikolay.Lunyak@jetbrains.com>
2022-10-07 13:33:49 +00:00
pyos a9ae1fcdf9 FIR CFG: handle loops and try/catch when analyzing smartcasts in lambdas
See KT-50092
2022-10-07 08:56:04 +00:00
pyos 77c2601382 Add a test where a local variable has the same name as a property 2022-10-07 08:56:02 +00:00
Ilya Kirillov fceb3425c8 [Analysis API FIR] fix invalid usages of CachedValue
it should not cache map as values are stored on soft references
2022-10-05 15:53:54 +00:00
Kristoffer Andersen fcabc60471 [FIR] Insert fake source for FIR for array access temporaries 2022-10-05 16:22:22 +02:00
Ilya Kirillov 49f2f85927 [Low Level FIR] fix exception when creating symbol by invalid code 2022-10-04 12:56:07 +00:00
Ilya Kirillov 24bf273b93 [Low Level FIR] add more info to error in LLFirResolvableResolveSession 2022-10-04 12:56:06 +00:00
Nikolay Lunyak e2fdb352f1 [FIR] KT-42962: Ensure the issue is not present in K2
Merge-request: KT-MR-7288
Merged-by: Nikolay Lunyak <nikolay.lunyak@jetbrains.com>
2022-10-04 12:27:17 +00:00
Dmitriy Novozhilov a6c7d4c0c6 [FIR] Analyze bodies of non delegated property accessors without expected type
^KT-53349 Fixed
2022-10-03 15:48:17 +03:00
Dmitriy Novozhilov 6623456d2a [FIR] Properly support @JvmRecord
^KT-53867 Fixed
2022-10-03 15:48:17 +03:00
Dmitriy Novozhilov c0ad67c4f9 [FIR] Generate java declarations for record components of java records
^KT-53964 Fixed
2022-10-03 15:48:17 +03:00
Ilya Kirillov e5a941030b [Low Level FIR] fix CME in java enhancement
Now all computations in FirThreadSafeCache are performed under lock

^KTIJ-23081 fixed
2022-10-02 19:00:02 +02:00
Ilya Kirillov 5772230357 [Low Level FIR] fix memory leak via use-site use session
^KTIJ-22749
2022-09-30 12:19:51 +02:00
Ilya Kirillov 913bfc0838 [Low Level FIR] fix one case in CME when traversing FIR tree
Before extra child nodes of classes were visited during declaration by ClassId search.
If some other thread was mutating this tree, CME could happen

this is a fix of one case from ^KTIJ-21791
2022-09-30 12:19:35 +02:00
Ilya Kirillov ae76ce666f [Low Level FIR] optimize getting callables in LLFirProviderHelper 2022-09-30 12:19:35 +02:00
Ilya Kirillov 556b7894d5 [Low Level FIR] do not search for declarations from kotlin. package in source modules 2022-09-30 12:15:49 +02:00
Ilya Kirillov ed65f62e3d [Low Level FIR] add more debug information to FirDeclarationForCompiledElementSearcher 2022-09-30 12:15:48 +02:00
Mikhail Glukhikh 75a29434bd K2: add reproducer of KT-54212 2022-09-29 10:55:04 +02:00
pyos 3a5d75fd22 K2: introduce platform-specific visibility checks for overrides + tests
Related to KT-53197
2022-09-29 08:34:13 +00:00
Mikhail Glukhikh 9f7c465eb0 FE: add test for KT-53197 2022-09-29 08:34:11 +00:00
Mikhail Glukhikh e9bb0f4fda Resolution: extract projections from captured flexible type properly
#KT-54100 Fixed
Related to KT-54196, KT-54198
2022-09-28 15:29:43 +00:00
Nikolay Lunyak f578381726 [FIR] KT-46483: Forbid annotations in where Clauses
Merge-request: KT-MR-7208
Merged-by: Nikolay Lunyak <lunyak.kolya@mail.ru>
2022-09-28 13:38:18 +00:00