Commit Graph

8931 Commits

Author SHA1 Message Date
Pavel V. Talanov 27d7bb595f CliLightClassGenerationSupport: correctly find facade files
This fixes a problem where JvmPackageName annotation could force file
    facades to be in the package different to declared kotlin package
2018-03-06 12:07:12 +01:00
Pavel V. Talanov 00ee5e3d16 Refactor: extract mapping package to files to a separate component
Make it extensible
2018-03-06 12:07:08 +01:00
Pavel V. Talanov d2b90b84f8 KotlinFileStubForIde: save full facadeFqName
Prefix is not necessarily same as packageFqName since JvmPackageName was introduced
2018-03-06 12:05:53 +01:00
Alexander Udalov f41165c566 Minor, use elvis in deprecationUtil.kt 2018-03-05 13:43:10 +01:00
Alexander Udalov e92e7c6f80 Do not report RequireKotlin-related diagnostics in snapshot compilers
Otherwise it's difficult to use a newly added API annotated with
RequireKotlin with the latest, not yet released, version.

For example, suppose there's a new function added in kotlin-stdlib,
since Kotlin 1.3, which requires 1.3 (Kotlin < 1.3 is supposed to report
an error on usages):

    @SinceKotlin("1.3")
    @RequireKotlin("1.3", COMPILER_VERSION, message = ...)
    fun foo() {}

Until Kotlin 1.3 is released, the latest available compiler in Maven has
the version 1.3-SNAPSHOT, which is _less_ than 1.3 according to Maven
rules which are used in getDeprecationByVersionRequirement. Therefore,
errors will be reported on usages of foo, and there's no Kotlin compiler
version which can be used to verify if the function works correctly,
which is inconvenient.

Since SNAPSHOT versions are effectively "pre-release" in a way, it's OK
for them to skip reporting these diagnostics
2018-03-05 13:39:13 +01:00
Alexander Udalov bbaea6a062 Refactor deprecation by version requirement
- Get rid of ApiVersion in favor of MavenComparableVersion
- Don't crash on invalid versions in RequireKotlin
- Extract to a separate function
2018-03-05 13:39:13 +01:00
Nikolay Krasko 90802f2d7c Refactoring: remove ModuleResolverProvider, inline createModuleResolverProvider 2018-03-05 15:20:53 +03:00
Yan Zhulanow 34d1611ed4 Add Pill support to compiler and IDE modules 2018-03-02 03:15:17 +03:00
Ilya Chernikov db7e06aaa4 Make dependencies to the script-runtime directly to the project...
instead to vie projectDist. With the current project bootstrap scheme a
dependency to the simply built script-runtime project via dist is not
needed anymore, but it breaks proper sources navigation in IDEA.
2018-02-28 19:29:05 +01:00
Nicolay Mitropolsky 2f6fb4091b making LambdaArgument methods nullable
overridden `LambdaArgument.getArgumentExpression` removed because it is already nullable in parent

#EA-117013
2018-02-28 12:13:12 +03:00
Toshiaki Kameyama 4726b44371 Add braces to 'if' statement: save/restore comments correctly
So #KT-16332 Fixed
2018-02-27 18:25:22 +03:00
Dmitry Petrov 8fbdf52d34 Chars are not promoted to Int on comparisons 2018-02-27 10:09:17 +03:00
Nikolay Krasko 08a46c1396 Refactoring: move idea source modules classes to caches/project package 2018-02-26 18:42:58 +03:00
Nicolay Mitropolsky 3a609a9472 Assertions to catch EA-114080 2018-02-22 12:51:50 +03:00
Ilmir Usmanov a0186224b2 Do not report NOTHING_TO_INLINE on suspend inline functions
#KT-22260: Fixed
2018-02-21 19:19:09 +03:00
Pavel V. Talanov 8f8cbfcfa5 KtAnnotationEntry#name is stubbed and is nullable 2018-02-21 14:44:09 +01:00
Pavel V. Talanov 8600add7f7 Refactor: extract utils related to DslMarker to a separate object 2018-02-21 14:44:08 +01:00
Dmitry Savvinov d570b863ce Introduce deprecation of companion objects nested classes
Introdude deprecation as per KT-21515. Warning is reported on type
usage, that soon will became invisible. Quickfix by adding explicit
import is added.

Idea behind implementation is to mark scopes that are deprecated (see
ClassResolutionScopesSupport).

Then, during walk along hierarchy of scopes, look at deprecation status
of the scope that has provided this classifier.
Note that we also have to check if there are *some* non-deprecated
visibility paths (because we can see classifier by two paths, e.g. if
we've added explicit import) -- then this type reference shouldn't be
treated as deprecated.
2018-02-21 16:04:49 +03:00
Alexey Sedunov 17e64ebae0 Move: Fix processing of callable references to nested Java classes and static methods
#KT-17827 Fixed
2018-02-21 13:21:20 +03:00
Alexey Sedunov 1af21dd160 Move: Warn about moving public declaration to non-public class
#KT-22771 Fixed
2018-02-21 13:21:18 +03:00
Dmitry Savvinov e071d054c9 Refactor DataFlowValueFactory implementation into several separate files 2018-02-20 13:11:33 +03:00
Dmitry Savvinov 0929673576 Refactor DataFlowValueFactory into proper component 2018-02-20 13:11:33 +03:00
Denis Zharkov 5edfc0f5cd Prohibit labeled returns inside kotlin.suspend argument lambdas
Probably, it would be more correct to skip such lambdas when resolving
the returns' references, but it'd be more complicated and still useless
since non-local returns are impossible in such lambdas
(relevant parameter is noinline)

 #KT-22900 Fixed
2018-02-19 17:30:26 +03:00
Mikhail Zarechenskiy bc2e81a1e4 Improve message for exception about absence of common supertype
Relates to #KT-16253
2018-02-19 17:16:24 +03:00
Nikolay Krasko ae0bd9cc8c Additional diagnostic for incorrect stub type in Kotlin file (EA-111617) 2018-02-16 13:29:54 +03:00
Mikhail Glukhikh 3f500a1655 Add "expectedBy" to module descriptor and use it in checker
Now ExpectActualDeclarationChecker in IDE context
uses common module descriptors for relevant checks.
Compiler still uses own module instead (see comment in checker)
So #KT-21771 Fixed
2018-02-14 15:09:14 +03:00
Mikhail Glukhikh 78136fbb07 IDE facet refactoring, ModuleInfo.expectedBy introduced.
Part of facet classes was extracted to idea-analysis module
Related to KT-21771
2018-02-14 15:09:14 +03:00
Mikhail Zarechenskiy 694f5690f9 [NI] Improve diagnostic about unresolved receiver for many candidates 2018-02-14 14:58:05 +03:00
Mikhail Zarechenskiy 3afd4a2f4a [NI] Record all diagnostics from subcalls resolution results 2018-02-14 14:58:04 +03:00
Mikhail Zarechenskiy 6a7a07bf9d [NI] Don't forget to report about unresolved callable reference 2018-02-14 14:58:04 +03:00
Dmitry Petrov 5a85bf36a5 Check for type parameter supertypes in primitive numeric comparisons 2018-02-09 14:41:54 +03:00
Alexey Sedunov 5c6bba9f14 Rename: Fix qualified expression replacement for the case 'invoke' <-> 'get'
#KT-22705 Fixed
2018-02-09 14:17:39 +03:00
Alexey Sedunov e88f1467eb Rename: Add quotes to declaration name if necessary
#KT-22708 Fixed
2018-02-09 14:17:38 +03:00
Alexey Sedunov 428b086458 Refactor: Move 'isIdentifier' and 'quoteIfNeeded' functions to frontend 2018-02-09 14:17:37 +03:00
Mikhail Zarechenskiy a59917b6f8 Generate synthetic box method for each erased inline class 2018-02-09 02:08:10 +03:00
Ilmir Usmanov 87bbac9d43 Take coroutineContext into account in RedundantSuspendModifierInspection
#KT-22651: Fixed
2018-02-08 19:34:20 +03:00
Alexander Udalov a4af9dd5d1 Always consider container's experimentality in ExperimentalUsageChecker
This results in more diagnostics usually, but allows library authors to
avoid annotating everything in each experimental class with the marker
(only the class needs to be annotated now)

 #KT-22759
2018-02-08 17:08:34 +01:00
Alexander Udalov 890374a42a Load module annotations for JVM and JS modules in compiler
#KT-22759 In Progress
2018-02-08 17:08:33 +01:00
Alexander Udalov ec6b49b8b8 Check experimental API markers for deprecation
#KT-22759 In Progress
2018-02-08 17:07:22 +01:00
Alexander Udalov 5e78adb501 Support -Xexperimental/-Xuse-experimental in ExperimentalUsageChecker
#KT-22759 In Progress
2018-02-08 17:07:22 +01:00
Alexander Udalov 77625831f7 Support -Xexperimental and -Xuse-experimental, validate their values
#KT-22759 In Progress
2018-02-08 17:07:22 +01:00
Alexander Udalov 153c86c069 Report diagnostic on overrides of experimental members
Unless they're experimental themselves

 #KT-22759 In Progress
2018-02-08 17:07:22 +01:00
Alexander Udalov 29c35e6686 Do not require experimental propagation for body usages in same module
Unless it's a usage inside the body of an effectively public inline
function

 #KT-22759 In Progress
2018-02-08 17:07:22 +01:00
Alexander Udalov 6d4e8f3781 Add some validation for Experimental/UseExperimental usages
#KT-22759 In Progress
2018-02-08 17:07:22 +01:00
Alexander Udalov 0bf0a315ed Introduce Experimental and UseExperimental annotations
#KT-22759 In Progress
2018-02-08 17:07:21 +01:00
Alexander Udalov b6a55f74f4 Support patch versions in RequireKotlin with kind=COMPILER_VERSION 2018-02-08 17:47:37 +03:00
Denis Zharkov 72222c718a Highlight callees resolved to kotlin.suspend as a keywords
#KT-22562 In Progress
2018-02-08 17:47:37 +03:00
Denis Zharkov 99c7d8d4d5 Add call checks related to suspend lambda modifier's introduction
- Prohibit non-modifier-like calls on kotlin.suspend
- Add warning on modifier-like calls to anything but kotlin.suspend

 #KT-22766 In Progress
 #KT-22562 In Progress
2018-02-08 17:47:37 +03:00
Denis Zharkov 342a532416 Minor. Inline parameters 2018-02-08 17:47:37 +03:00
Alexander Udalov 22595acbfd Fix AssertionError on overloading function with property in actual class
#KT-22352 Fixed
2018-02-08 14:11:56 +01:00