Commit Graph

9836 Commits

Author SHA1 Message Date
rapturemain 4e577caa99 [FIR] Support for EXPOSED_FUNCTION_RETURN_TYPE 2020-04-20 17:25:25 +03:00
rapturemain 0f16c88dd2 [FIR] Support for FIR_EXPOSED_RECEIVER_TYPE 2020-04-20 17:25:24 +03:00
rapturemain 02c90c6576 [FIR] Support for EXPOSED_PROPERTY_TYPE 2020-04-20 17:25:24 +03:00
rapturemain cc86767a23 [FIR] Support for EXPOSED_TYPEALIAS_EXPANDED_TYPE 2020-04-20 17:25:24 +03:00
Pavel Kirpichenkov b91cf13259 [NI] Fix expicit super receiver check
^KT-37497 Fixed
2020-04-20 10:56:13 +03:00
Ilya Muradyan af251cafa4 Add info about the end of range in scripting REPL compiler messages 2020-04-16 21:16:08 +02:00
Vladimir Dolzhenko b0483a67c2 Perform tryLock-and-checkCanceled on waiting lock in LockBasedStorageManager
Relates to #KT-38012
2020-04-14 13:11:30 +02:00
Mikhail Zarechenskiy a7b959b88b Fix delegated property resolve with intermediate ID provideDelegate
#KT-37406 Fixed
2020-04-09 13:34:29 +03:00
Dmitry Petrov d1c5a42124 KT-36024 Generate adapted callable references as lambdas
Make sure both JVM and JVM_IR use the same information to determine
whether a callable reference requires argument adaptation.
2020-04-08 19:02:33 +02:00
Alexander Gorshenev 97be5617ca Renamed -Xklib-mpp to -Xexpect-actual-linker to reduce user confusion 2020-04-08 05:23:12 +03:00
Mikhail Zarechenskiy 73e1ddc505 Allow Result as a return type if one enabled inline classes explicitly
#KT-38042 Fixed
2020-04-08 01:25:13 +03:00
Florian Kistner b7e270f1c1 Add listener for module descriptor invalidation 2020-04-06 14:01:06 +02:00
Mikhail Zarechenskiy 38a719cb22 [NI] Fix trace manipulations for builder inference and ::-expressions
For a class literal Type::class we are resolving Type as a constructor,
 getting all diagnostics (about missing arguments, for example) and then
 just not committing this trace with errors

 #KT-37626 Fixed
2020-03-31 15:50:58 +03:00
Pavel Kirpichenkov 0abe3a6c39 [NI] Report not-a-class LHS error for callable reference arguments
^KT-37531 Fixed
2020-03-31 12:04:01 +03:00
Pavel Kirpichenkov a416fde814 [NI] Move abstract class instantiation check to call checkers
This way the check works for callable reference arguments.
Also candidate applicability during resolution does not change compared to the old inference.
^KT-37530 Fixed
2020-03-31 12:04:01 +03:00
Victor Petukhov a29385e758 [Spec tests] Small clean-up CheckerTestUtil and around it 2020-03-30 11:15:55 +03:00
anastasiia.spaseeva f7ff60cb77 [Spec tests] Add DEBUG_INFO_AS_CALL diagnostic tag for callable references 2020-03-30 11:15:53 +03:00
anastasiia.spaseeva 008a0df28f [Spec tests] DEBUG_INFO_LEAKING_THIS diagnostics type is changed from error to  info 2020-03-30 11:15:53 +03:00
Alexander Udalov b6fdc96994 Reverse dependency 'psi' <-> 'frontend.common'
Move ParseUtils to 'psi', and ImportPath to 'frontend.common'.

Now 'psi' depends on 'frontend.common', and that allows to remove
dependency of 'fir:tree:tree-generator' on 'psi', allowing the former to
compile in parallel with the old frontend code.
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
Alexander Udalov 4dcd0d1cb6 Extract module 'config' out of 'frontend'
Also move deprecated TargetPlatform there. This allows to get rid of the
dependency cli.common -> frontend, and even on frontend.common.
2020-03-28 21:30:05 +01:00
Alexander Udalov 90ae416b72 Minor, move KotlinTypeRefinerImpl out of 'config' package 2020-03-28 21:30:04 +01:00
Alexander Udalov 4aa47be202 Move CommonResolverForModuleFactory to 'frontend'
This will allow to get rid of dependency of 'cli-common' on 'frontend'.
2020-03-28 21:30:04 +01:00
Alexander Udalov 8dd04789ad Remove obsolete InlineStrategy
Replace corresponding metadata property in js.ast with Boolean. This
allows to get rid of dependency of 'js.ast' on 'frontend'.
2020-03-28 21:30:03 +01:00
Mikhail Glukhikh 7bfd354a77 Don't report UNUSED_PARAMETER in main from object #KT-37718 Fixed 2020-03-27 16:46:59 +03:00
Leonid Startsev 2bda31ac38 Exclude annotation properties in 'explicit visibility' api mode check
#KT-37432 fixed
2020-03-25 19:41:52 +05:00
Mikhail Zarechenskiy b23aff4d0d [NI] Type-check lambda arguments against approximated type
It's required as we analyze lambda with the approximated type too
2020-03-23 16:39:20 +03:00
Ilya Chernikov 831806fe2f Revert "Optimize MutableDiagnosticsWithSuppression"
Fixes flaky tests on windows:
QuickFixTestGenerated$Suppress$AnnotationPosition
  .testTopLevelFunctionSuppressOnFile
  .testTopLevelFunctionSuppressOnFileWithSuppress
2020-03-20 08:02:25 +01:00
Ilya Chernikov 950ab01596 Avoid substitution and type approximation for simple calls
#KT-37392 fixed
2020-03-18 18:34:09 +01:00
Mikhail Glukhikh 26f919df03 Fix some nullable usages of not-null type parameters (KT-36770) 2020-03-18 10:24:26 +03:00
Dmitriy Novozhilov 31776d9a3b [CFA] Mark arguments of all annotation calls as USED_AS_EXPRESSION
Also revert hacky fix of KT-37294 introduced in 80caa063b
#KT-37447 Fixed
2020-03-13 14:32:28 +03:00
Ilya Chernikov 6f97745de2 Optimize MutableDiagnosticsWithSuppression
avoid modificationTracker and own diagnostics list initialization if
possible
2020-03-12 08:02:46 +01:00
Ilya Chernikov b6c9432334 [minor] Optimize diagnostic reporting a bit
Eliminating a couple of function calls on reporting, speeds up
diagnostic tests for a few %
2020-03-12 08:02:45 +01:00
Ilya Chernikov 2727507d18 Fix diagnostic inferred type calculation for null in some cases
#KT-36222 fixed
2020-03-12 08:02:45 +01:00
Alexander Udalov 795d6ab407 Migrate UseExperimental->OptIn in project sources 2020-03-10 12:07:14 +01:00
Leonid Startsev 5d73550b48 Do not check visibility of enum entries in explicit api mode
Although they're instances of DeclarationDescriptorWithVisibility,
they can't have visibilities

#KT-37040 Fixed
2020-03-10 11:55:59 +03:00
Sergey Igushkin 3858c8e1f8 Support friend internal visibility in K2Metadata compiler (KT-37264)
Add and handle the friend paths and refines paths compiler arguments;
Reuse klib dependency module descriptors in the resolver for project;

Issue #KT-37264
2020-03-06 15:56:40 +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
Vladimir Dolzhenko d1a29df581 Revert "Added AllowNullableArrayArgsInMain (1.4+) language setting"
#KT-35965 Fixed
2020-03-05 14:08:27 +01:00
Vladimir Dolzhenko 15e2afe5ab Add checkCanceled on common for autocompletion and highlighting resolve path 2020-03-04 08:59:17 +01:00
Vladimir Dolzhenko 91ee63432a Disable CacheResetOnProcessCancele by default 2020-03-02 11:42:19 +01:00
Dmitry Petrov 2010d8d2b9 KT-36956 fix back-end part in JVM and JVM_IR
PSI2IR: deparenthesize LHS expression when generating assignment
receiver.

FE: record 'set' operator call for code generation.
2020-02-28 23:04:42 +03:00
Mikhail Zarechenskiy 14f7529c1b [NI] Reanalyze coroutine-block if there is inapplicable call
It's not clear how one should rollback _all_ resolution results if
 there is inapplicable call. Ideally, such calls should not be available
 in coroutine block but for now, to have backward compatibility, we'll
 just reanalyze coroutine block as a usual lambda if there is at least
 one such call.

 As a result, also remove diagnostic about non-applicable call as it
 become useless with current reanalysis

 #KT-37061 Fixed
 #KT-32097 Fixed
 #KT-32203 Fixed
 #KT-35306 Fixed
 #KT-36202 Fixed
 #KT-36220 Fixed
 #KT-32654 Fixed
2020-02-28 10:25:22 +03:00
Mikhail Zarechenskiy 5ed28b38be [NI] Fix coroutine inference for qualified chained call with stub type 2020-02-26 17:16:15 +03:00
Mikhail Zarechenskiy 6eec8c28ad Add JvmDefault to recently added method for compiler extensions
This should fix AbstractMethodError when newer compiler is used with
 Compose plugin that haven't implemented recently added method

 #KT-37042 Fixed
2020-02-26 13:16:05 +03:00
Stanislav Erokhin 453008e488 Deprecated reportFromPlugin way to report diagnostics from plugin
Originally reportFromPlugin method was introduced to address the problem
with loading of DefaultErrorMessages.Extension vis ServiceLoader.
For some cases this extension was not loaded by ServiceLoader because
classes was loaded via different class loader, common scenario here is
compiler plugins. Ideally we should load such extension point via
getService approach, but unfortunately to do that we need project and
DefaultErrorMessages.render is static method for now.
Also with reportFromPlugin approach is a problem -- all diagnostics
reported via this method has the same id: PLUGIN_[WARNING|ERROR|INFO]
and it isn't possible to suppress only one particular diagnostic.
To bypass this problem the new method
initializeFactoryNamesAndDefaultErrorMessages was introduced.
It basically store DiagnosticRenderer inside DiagnosticFactory.
It is not ideal, because one DiagnosticFactory could have different
renderers for different scenarios -- for compiler and for IDE, but
I think that it is better than reportByPlugin approach.
2020-02-26 12:12:31 +03:00
Mikhail Zarechenskiy 5393074d61 [NI] Update type of complex subcall for last lambda expressions 2020-02-25 15:26:25 +03:00
Mikhail Zarechenskiy 0b9fc1541d [NI] Don't try inferring variables for effectively empty system 2020-02-25 10:45:59 +03:00
Mikhail Zarechenskiy f2f95496e3 [NI] Complete contradictory candidates inside builder-inference
In this test `kotlin` was resolved to the extension
 `val Class<T>.kotlin` because it was saved in builder-inference.
 Usually, it's fine, but not for qualified expressions as they have
 fallback resolve in case of error
2020-02-21 17:39:50 +03:00
Mikhail Zarechenskiy 1624327ba4 [NI] Fix substitution in builder-inference for empty common system 2020-02-21 14:24:57 +03:00