Commit Graph

2655 Commits

Author SHA1 Message Date
Victor Petukhov 756326cefe NI: report error diagnostic about impossible to infer anonymous function's parameter
Partially fixed KT-39098
2020-05-25 19:37:27 +03:00
Mikhail Zarechenskiy 2cee82a348 [NI] Resolve receiver of provideDelegate independently
#KT-38259 Fixed
2020-05-25 16:06:55 +03:00
Mikhail Glukhikh 7840adde12 [IR] Unbind construction methods of IrConstructorImpl from symbol.descriptor 2020-05-25 15:40:36 +03:00
Mikhail Glukhikh 262548fd5b [IR] Unbind construction methods of IrFunctionImpl from symbol.descriptor 2020-05-25 15:40:36 +03:00
Mikhail Glukhikh a7d514a0a9 [IR] Unbind construction methods of IrClassImpl from symbol.descriptor 2020-05-25 15:40:35 +03:00
Victor Petukhov a84780fefb NI: Add regression test for KT-38799
The issue has been fixed by introducing the modified postponed arguments analysis (KT-37952)
2020-05-25 11:56:08 +03:00
Dmitriy Novozhilov d49c198a7f [FIR] Correctly initialize extensions in all sessions 2020-05-24 18:04:47 +03:00
Dmitriy Novozhilov 96da6d35c5 [FIR] Add processor for transforming statuses with plugins 2020-05-24 18:04:47 +03:00
Dmitriy Novozhilov 8d686226c7 [FIR] Introduce FirResolveProcessors 2020-05-24 18:04:47 +03:00
Dmitriy Novozhilov 3de12f9b09 [FIR] Completely remove old extensions service 2020-05-24 18:04:47 +03:00
Dmitriy Novozhilov 9a8d520b85 [FIR] Remove first version of class generation transformer 2020-05-24 18:04:46 +03:00
Dmitriy Novozhilov 3e3387fb69 [FIR] Remove extension status transformation from status resolve 2020-05-24 18:04:46 +03:00
Dmitriy Novozhilov 006232dfb2 [FIR] Fix FirPluginAnnotationsResolveTransformer 2020-05-24 18:04:46 +03:00
Dmitriy Novozhilov 206a646195 [FIR] Use caches for predicate matching 2020-05-24 18:04:45 +03:00
Dmitriy Novozhilov 594a854b4e [FIR] Reimplement FirExtensionService
- Get rid of old FirExtensionsService
- Implement new FirExtensionService
- Remove duplicating code in FirExtensionRegistrar
2020-05-24 18:04:45 +03:00
Dmitriy Novozhilov 846db641be [FIR] Make ArrayMap iterable 2020-05-24 18:04:45 +03:00
Dmitriy Novozhilov 5c12b3df95 [FIR] Introduce FirPredicateBasedProvider 2020-05-24 18:04:45 +03:00
Dmitriy Novozhilov 0b00015424 [FIR] Deprecate FirExtensionsService 2020-05-24 18:04:44 +03:00
Dmitriy Novozhilov f3d4fa715e [FIR] Introduce DeclarationPredicates for matching declarations for extensions 2020-05-24 18:04:44 +03:00
Dmitriy Novozhilov 74353d8bc9 [FIR] Introduce FirAnnotatedDeclaration 2020-05-24 18:04:44 +03:00
Dmitriy Novozhilov f764baad82 [FIR] Add extension with additional checkers 2020-05-24 18:04:43 +03:00
Dmitriy Novozhilov 04a1027b39 [FIR] Add empty instances of DeclarationCheckers and ExpressionCheckers 2020-05-24 18:04:43 +03:00
Dmitriy Novozhilov c0a57ae55c [FIR] Move expression checkers from package call to expression 2020-05-24 18:04:43 +03:00
Dmitriy Novozhilov 6d6ed1e755 [FIR] Create session component with registered checkers 2020-05-24 18:04:43 +03:00
Victor Petukhov 379c6944a2 NI: extract diagnostics from partially resolved call instead of separately handling it including running all checks
^KT-37630 Fixed
^KT-35494 Fixed
2020-05-22 22:13:53 +03:00
Mikhail Likholetov 80cd26c9df [FIR] Support several annotation class diagnostics 2020-05-21 18:01:36 +03:00
Pavel Kirpichenkov 0b33e9430b [NI] Report unstable smart cast directly instead of using SmartCastManager
Fix compilation errors, revealed by this fix.

SmartCastManager is unnecessary for error reporting, intermediate diagnostics from the NI contain all required infromation.
When SmartCastManager is used it leads to missing unstable smart casts in case of expressions with captured types.
This happens, because data flow info is recorded for original expression without captured types, which is used as a key.
DataFlowValues created from receivers with captured types can't be used to retrieve that info.

^KT-39010 Fixed
2020-05-21 17:09:10 +03:00
Jinseong Jeon 7a947e8008 FIR: fix default constructor visibility for enum entry. 2020-05-21 08:40:03 +03:00
Jinseong Jeon 0d3301b695 FIR: resolve local class in anonymous initializer. 2020-05-21 08:36:49 +03:00
Victor Petukhov 12db3d6e83 NI: remove separation of variable fixation order by constraint kind
The commit partially reverts ec4d9d2f1f

^KT-37914 Fixed
2020-05-20 22:37:30 +03:00
Mikhail Zarechenskiy 8bdc4d34f7 [NI] Commonize type-conversions (SAM/Suspend)
- Allow participating subtypes of functional types in conversions
 - Fix several subtle inconsistencies
 - Place logic about conversions at one place

 Now conversions operations have two stages: before usual subtyping
 check and after one. This is needed to support conversions of
 subtypes (of functional types, for example). First, the compiler
 checks if it possible to resolve an argument without conversion and
 only then it tries to perform conversion.
 Note that it'd be incorrect to perform conversion eagerly as it can
 change resolve (Runnable & () -> Unit <: KRunnable), plus we can't
 guess whether conversion is needed at all as it's important not to
 look into supertypes if resolution doesn't actually needed it

 #KT-36448 Fixed
 #KT-37574 Fixed
 #KT-38604 Fixed
2020-05-20 15:30:14 +03:00
Kevin Most 4f26ac9a04 Fix "Koltin" typos throughout codebase (#3383)
* Fix "Koltin" typos throughout codebase

* Update K2MetadataKlibSerializer.kt
2020-05-20 15:12:32 +03:00
Dmitriy Novozhilov dc57d307f3 [FIR] Clean data flow context before body resolve of file 2020-05-20 10:41:03 +03:00
Dmitriy Novozhilov 8df635a4e0 [FIR] Add cleanup of tower data for imports 2020-05-20 10:41:02 +03:00
Dmitriy Novozhilov b05546dd64 [FIR] Add check for session consistency in body resolve transformer 2020-05-20 10:41:02 +03:00
Dmitriy Novozhilov 371757309e [FIR] Don't recreate transformer in FirBodyResolveTransformerAdapter 2020-05-20 10:41:01 +03:00
Dmitriy Novozhilov 4e07f8180b [FIR] Don't recreate transformer in FirImplicitTypeBodyResolveTransformerAdapter 2020-05-20 10:41:01 +03:00
Dmitriy Novozhilov c4407d6d63 [FIR] Don't recreate transformer in FirContractResolveTransformerAdapter 2020-05-20 10:41:00 +03:00
Dmitriy Novozhilov c1080989b6 [FIR] Suppress pointless unchecked casts in FirStatusResolveTransformer 2020-05-20 10:41:00 +03:00
Dmitriy Novozhilov 329af65996 [FIR] Get rid of FirStatusResolveTransformerAdapter 2020-05-20 10:40:59 +03:00
Dmitriy Novozhilov 93992d1d75 [FIR] Get rid of FirTypeResolveTransformerAdapter 2020-05-20 10:40:58 +03:00
Dmitriy Novozhilov ca4deec10e [FIR] Don't recreate transformers in FirSupertypeResolverTransformer 2020-05-20 10:40:58 +03:00
Dmitriy Novozhilov dc30bf5d09 [FIR] Don't recreate transformers in FirPluginAnnotationsResolveTransformer 2020-05-20 10:40:57 +03:00
Dmitriy Novozhilov 0544369503 [FIR] Add transformImports to FirFile 2020-05-20 10:40:57 +03:00
Dmitriy Novozhilov f60c8eac71 [FIR] Don't rewrite session in FirImportResolveTransformer 2020-05-20 10:40:56 +03:00
Dmitriy Novozhilov 67a259a903 [FIR] Get rid of FirSymbolProvider.getInstance(session)`
Replace with `session.firSymbolProvider`
2020-05-20 10:40:56 +03:00
Dmitriy Novozhilov 24c8a659ee [FIR] Add FirSession as parameter for FirTotalResolveTransformer 2020-05-20 10:40:55 +03:00
Dmitry Petrov cf70c83ab7 JVM: Update tests 2020-05-20 07:19:29 +03:00
Dmitry Petrov 2f82c5b6af JVM: Fix default parameter values handling
When we generate call for 'foo', we make decision about invoking
a 'foo$default' too late, after the call arguments are generated.
If 'foo' was an override, and base class (interface) was generic,
'foo' in base class could have a different Kotlin and JVM
signature, so the arguments we generated could be generated wrong
(primitive or inline class values instead of boxes, see KT-38680).
Also, we always selected first base class in supertypes list,
which caused KT-15971.

Look into resolved call and see if we should actually call
'foo$default' instead of 'foo' when determining actual callable.

Overrides can't introduce default parameter values, and
override-equivalent inherited methods with default parameters
is an error in a child class. Thus, if we are calling a class
member function with a default parameters, there should be one
and only one overridden function that has default parameter values
and overrides nothing.
2020-05-20 07:19:29 +03:00
Dmitry Petrov dc9f64fc9d JVM: Fix reflection tests for new IC ABI 2020-05-20 07:19:28 +03:00