Commit Graph

2418 Commits

Author SHA1 Message Date
Mikhail Zarechenskiy 2cee82a348 [NI] Resolve receiver of provideDelegate independently
#KT-38259 Fixed
2020-05-25 16:06:55 +03:00
Victor Petukhov eff5f3a242 NI: do type checking for anonymous functions not inside a call
^KT-38890 Fixed
^KT-38439 Fixed
2020-05-19 16:29:14 +03:00
Victor Petukhov 260683c20e NI: Improve postponed arguments analysis
Introduce seven stages:
1) Analyze postponed arguments with fixed parameter types
2) Collect parameter types from constraints and lambda parameters' declaration
3) Fix not postponed variables for parameter types of all postponed arguments
4) Create atoms with revised expected types if needed
5) Analyze the first ready postponed argument and rerun stages if it has been analyzed
6) Force fixation remaining type variables: fix if possible or report not enough information
7) Force analysis remaining not analyzed postponed arguments and rerun stages if there are

^KT-37952 Fixed
^KT-32156 Fixed
^KT-37249 Fixed
^KT-37341 Fixed
2020-05-07 11:42:00 +03:00
Mikhail Zarechenskiy 1a26d2e157 Fix exception during resolution of incorrect fun interface
#KT-37541 Fixed
2020-04-29 14:15:25 +03:00
Mikhail Zarechenskiy 780bc1f607 Fix fun interfaces with extension receivers
#KT-37712 Fixed
2020-04-29 14:15:25 +03:00
Pavel Kirpichenkov dfc86dbf63 [NI] Avoid type rendering in member scope for intersection type
KT-38544
2020-04-28 12:53:09 +03:00
Dmitriy Dolovov 90e888a1b6 Discriminate overloading expect MemberDescriptors
Issue #KT-38298
2020-04-28 13:16:18 +07:00
Dmitriy Dolovov 22dc837e26 IDE. Allow expect declarations in completion in shared native modules
Issue #KMM-218
2020-04-21 10:21:19 +07:00
Jinseong Jeon c26adf53dd FIR: resolve suspend lambda properly 2020-04-20 17:05:30 +03:00
Georgy Bronnikov 2c4fcebfec IR: handle adapted bound references 2020-04-18 20:31:57 +03:00
Mikhail Zarechenskiy 4ffcbc0c2f [NI] Properly support UnsafeVariance annotation
#KT-38134 Fixed
 #KT-34433 Fixed
 #KT-31823 Fixed
2020-04-16 13:55:47 +03:00
Mikhail Zarechenskiy 9607739d30 Introduce synthetic scope for constructors of fun interfaces
#KT-37434 Fixed
2020-04-15 02:37:34 +03:00
Mikhail Zarechenskiy e9e21caeaf Refactoring: move utils to create & initialize SAM constructors to core 2020-04-15 02:29:57 +03:00
Mikhail Zarechenskiy cf90fe81ac Move Sam(TypeAlias)ConstructorDescriptor to core 2020-04-15 02:06:32 +03:00
Mikhail Zarechenskiy 54497d11ac Move SyntheticMemberDescriptor.kt to core
This is a first part of unification SAM constructors for all platforms
2020-04-15 02:06:32 +03:00
Dmitriy Dolovov 0a2429c6f6 Minor. Remove redundant import 2020-04-14 21:14:33 +07:00
Dmitriy Dolovov 6d0e73191c HMPP: Fix detection of NativePlatform in CompositeResolverForModuleFactory 2020-04-14 21:07:44 +07:00
Dmitriy Dolovov fee6a752e0 HMPP: Fix serialization of TargetPlatform in Kotlin facet 2020-04-14 21:07:22 +07:00
Dmitriy Dolovov adc457548b Minor. Formatted 2020-04-14 21:07:16 +07:00
Dmitriy Dolovov 0f60b5a71e HMPP: Avoid false positive detection of "common native" as "common" 2020-04-14 21:07:00 +07:00
Victor Petukhov 164f25937f NI: take into account an extension function annotation during CST calculation 2020-04-02 15:28:35 +03:00
Alexander Udalov 92534eadaa Remove dependency of 'resolution' on 'deserialization'
Replace it with a dependency on 'descriptors'.

Move the existing marker interface ContractProvider to 'descriptors',
and create a new marker interface DeserializedDescriptor.
2020-03-28 21:30:07 +01:00
Alexander Udalov d70271b6aa Move RequireKotlinNames to 'descriptors'
Also move version string regex there and rename the class to
RequireKotlinConstants. This allows to get rid of dependency of
'serialization' on 'frontend'.
2020-03-28 21:30:07 +01:00
Roman Golyshev 85bfbaa8a8 Check if returned typeParameters are null
- See EA-141456, EA-212070
2020-03-24 15:23:34 +03:00
Mikhail Zarechenskiy 191fb02bf6 [NI] Consider intersection type with number type as Nothing
Currently, only for "in": In<in Int & A> == In<in Nothing> == In<*>

 #KT-37302 Fixed
2020-03-23 16:39:21 +03:00
Ilya Chernikov 53d289206e Optimize hot TypeUtils.contains function
optimize for small number of visited types
2020-03-12 08:02:45 +01:00
Pavel Kirpichenkov 04f9a03796 [NI] Fix isNullableType for definitely not null type parameter
Consider type parameter with nullable bound not null
if it is inside of a definitely not null type.
2020-03-11 13:55:25 +03:00
Alexander Udalov d668808b44 Migrate Experimental->RequiresOptIn in project sources 2020-03-10 12:07:15 +01:00
Alexander Udalov 795d6ab407 Migrate UseExperimental->OptIn in project sources 2020-03-10 12:07:14 +01:00
Victor Petukhov 92a0ddfe71 NI: discard def not null types if they appear in return positions, in inv or in variance
^KT-37343 Fixed
2020-03-08 19:00:27 +03:00
Pavel Kirpichenkov dc42b20ae3 [NI] Use alternative to intersection type in public declarations
The new inference uses inferred intersection types normally, unlike the old inference.
However, intersection types in public declarations are approximated to supertype, which
potentially may give a less presice type, then it would be with the OI.
For non-related T1, T2 the NI approximates {T1 & T2} to Any in public declarations,
and if the OI was inferring T1 instead of the intersection type, it may lead to
less precise declaration type and related errors.

The solution is to remember an alternative for an intersection type when present.
Before approximation the alternative replaces the intersection type.

^KT-36249 Fixed
2020-03-05 20:20:47 +03:00
Dmitry Petrov 03913ff029 KT-33119 Generate IINC for primitive types only 2020-02-28 23:20:02 +03:00
Roman Artemev bb43a66716 [Metadata] Add platform dependent type transformer
- Fix forward declaration type construction
2020-02-26 14:55:54 +03:00
Denis Zharkov 071149e0fb Fix exception when Java class has different methods with same erasure
^KT-36856 Fixed
2020-02-20 14:06:13 +03:00
Mikhail Zarechenskiy d169435300 Fix construction of Mock classes in case of generic inner types
This fixes testMissingDependencyConflictingLibraries for NI and also
 fixes changed test for OI as well
2020-02-20 12:34:35 +03:00
Mikhail Glukhikh e051251b27 FIR: set isOperator only for Java methods with appropriate names
#KT-35133 Fixed
2020-02-19 18:09:04 +03:00
Denis Zharkov aac72871e7 Fix UI freezes caused by calls with a huge number overloads
While we have an overload resolution algorithm working for O(n^2),
call resolution for the single particular call may work more then just
a second.
Thus, we need to call ProgressManager.checkCanceled() with more granularity

^KT-35135 Fixed
2020-02-18 20:07:14 +03:00
Denis Zharkov 842e2dc02f Optimize retaining most specific methods in LazyJavaScope
See 62a55b7b00
Previously, it was working for O(n^2)
Now, we first group it by jvm descriptor,
then for each groups of size g_i finding the most specific for O(g_i^2)

It should help for the cases when we have a lot of overloads with
different JVM descriptors (modulo return type)
NB: Having the same JVM descriptors is rather rare, because
in Java one cannot generate such a class.

Looks like it's only possible for Scala or some other JVM languages (KT-17560)

It should help a lot for KT-35135
2020-02-18 20:07:13 +03:00
Denis Zharkov d06e35b061 Minor. Reformat overridingUtils.kt 2020-02-18 19:59:56 +03:00
Roman Artemev df7b7cf61a [K/N] Provide original class id for forward-declared declarataion 2020-02-14 18:22:15 +03:00
Mikhail Zarechenskiy c1db9b6d40 [NI] Fix incremental compilation for SAM adapters
This commit fixes test:
 - JavaUsedInKotlin.SamConversions#testMethodAddedSamAdapter
2020-02-13 11:16:00 +03:00
Alexander Udalov d4170bca6e Regenerate generated files after updating copyright year 2020-01-30 12:41:42 +01:00
Mikhael Bogdanov 6c07dbf351 JVM_IR. Support type annotations 2020-01-29 16:59:55 +01:00
Mikhail Zarechenskiy 0530f9ed1c Refactoring: generify and remove duplicated code 2020-01-27 11:03:57 +03:00
Mikhail Zarechenskiy 4e3c27c4ec Refactoring: move SamConversionOracle to core 2020-01-27 11:03:57 +03:00
Mikhail Zarechenskiy 00469712d1 [NI] Don't use only platform specific checks for FIC in inference 2020-01-27 11:03:55 +03:00
Mikhail Zarechenskiy 76a78fe918 FIC: render fun before interfaces in descriptor renderer 2020-01-17 19:37:48 +03:00
Mikhail Zarechenskiy 70094884ca FIC: support suspend conversions in jvm codegen 2020-01-17 19:36:11 +03:00
Mikhail Zarechenskiy 0fdebdfeba Refactoring: move SamConversionResolverImpl to core module 2020-01-17 19:36:07 +03:00
Mikhail Zarechenskiy cd5c1b96bb Refactoring: move SamConversionResolver to more applicable package 2020-01-17 19:36:07 +03:00