Commit Graph

34295 Commits

Author SHA1 Message Date
Valentin Kipyatkov 59269ef1ae ParameterName annotation on type argument used to hold parameter name 2016-10-11 23:38:51 +03:00
Valentin Kipyatkov 3bd39df587 No parameter names in types for error messages 2016-10-11 23:38:50 +03:00
Valentin Kipyatkov 6527ada775 Changes on code review 2016-10-11 23:38:50 +03:00
Valentin Kipyatkov c0ea237ba4 Added test with type alias 2016-10-11 23:38:50 +03:00
Valentin Kipyatkov d8759fcbcc Optimizations 2016-10-11 23:38:50 +03:00
Valentin Kipyatkov 6b94e5fd34 Use parameter names from function type for invoke() function
#KT-435 Fixed
 #KT-9016 Fixed
2016-10-11 23:38:49 +03:00
Valentin Kipyatkov 0abb2edb2b Corrected test 2016-10-11 23:38:49 +03:00
Valentin Kipyatkov 41ee06ec96 Use parameter names in DescriptorRenderer 2016-10-11 23:38:49 +03:00
Valentin Kipyatkov f335f32b48 Some use of parameter names in completion 2016-10-11 23:38:48 +03:00
Valentin Kipyatkov 147d1da1ed Supported obtaining function type parameter names from KotlinType 2016-10-11 23:38:48 +03:00
Valentin Kipyatkov 8d7b59777c Moved and renamed tests 2016-10-11 23:38:48 +03:00
Alexander Udalov 4eac12e350 Report warning when SinceKotlin value is greater than -api-version value
To prevent this diagnostic be reported in each test on SinceKotlin, disable it
when a diagnostic test contains the "!API_VERSION" directive
2016-10-11 17:46:14 +03:00
Alexander Udalov 167ab1f860 Introduce "-api-version" CLI option
The `@SinceKotlin("X.Y.Z")` annotation now hides a particular declaration from
resolution when the API version specified by the `-api-version` option is
_less_ than X.Y.Z. The comparison is performed as for versions in Maven:
MavenComparableVersion is in fact a copy of
org.apache.maven.artifact.versioning.ComparableVersion.

Also support "!API_VERSION" directive in diagnostic tests

 #KT-14298 Fixed
2016-10-11 17:46:01 +03:00
Alexander Udalov e3df8ed2fe Introduce SinceKotlin annotation, check validity of its value
#KT-14297 Fixed
2016-10-11 17:45:51 +03:00
Alexander Udalov 8d660c2f6e Refactor gradle option generation mechanism
Ensure there's a statically checked dependency on LanguageVersion and
JvmTarget, so that this information is updated automatically once a new
language version or a JVM target is added
2016-10-11 17:30:15 +03:00
Alexander Udalov 2c66d4e59b Move LanguageVersionSettings and JvmTarget to module 'util'
To be used from cli-common in the subsequent commits
2016-10-11 17:30:14 +03:00
Alexander Udalov aaeae8b948 Support deprecation level HIDDEN for classifiers
Classifiers annotated with `@Deprecated(level = HIDDEN)` now have smaller
priority in imports, similarly to private classes. For example, if two
classifiers named Foo are imported with a star import and one of them is
deprecated-hidden, the name Foo in the source code is resolved to the other
one.

Also a minor change in multi-module diagnostic tests: do not append newlines
after the last module in the test

 #KT-13926 Fixed
2016-10-11 17:30:14 +03:00
Alexander Udalov 83c86d06ed Report error instead of warning for deprecation level HIDDEN
Since functions usually are hidden from resolution when they are
deprecated-hidden, the problem can only be reproduced for properties with
deprecated-hidden accessors, where DeprecatedCallChecker reported warnings
instead of errors
2016-10-11 17:30:13 +03:00
Alexander Udalov 6e0e8c6dc3 Pass LanguageVersionSettings instance to isHiddenInResolution
Unused at the moment, will be used later to check if the API version prohibits
the usage of the element
2016-10-11 17:30:12 +03:00
Alexander Udalov 59b29cf00d Minor, extract isDeprecatedHidden for usage in codegen
Also remove a hundred year old TODO
2016-10-11 17:30:11 +03:00
Alexander Udalov 2e4592c6dc Report error on bound callable references in compatibility mode
Previously examples were failing with IllegalStateException from JVM back-end
because there was an error type without any error reported
2016-10-11 17:30:10 +03:00
Valentin Kipyatkov 73dc5fefcb KT-12077 Code completion inserts FQN for annotations with use-site target inside primary constructor
KT-13009 Kotlin: annotation auto-import is broken in multiple ways

  #KT-12077 Fixed
  #KT-13009 Fixed
2016-10-11 17:26:52 +03:00
Valentin Kipyatkov 0c14058d13 Moved tests 2016-10-11 17:26:52 +03:00
Ilya Gorbunov 16a0c55c6c Since 'printStackTrace' now fallbacks to the extension in stdlib, change the test expecting it to be deprecated due to language-version 1.0 accordingly. 2016-10-11 16:46:14 +03:00
Ilya Gorbunov a239231c75 Revert dropping inline-only extensions for Throwable, to be able to use runtime of 1.1 with language version of 1.0 which makes mapped builtin members unavailable again.
#KT-14213 Fixed
2016-10-11 16:46:14 +03:00
Dmitry Jemerov fc46afc108 reduce ComponentRegistry memory use
#KT-13136 Fixed
2016-10-11 15:35:06 +02:00
Dmitry Petrov 2cd6b1d586 KT-14282 No error on unused type alias with -language-version 1.0
Always resolve descriptors for type aliases.
2016-10-11 16:33:21 +03:00
Mikhail Glukhikh 206374cd17 Minor refactoring: destructure intention 2016-10-11 16:13:21 +03:00
Mikhail Glukhikh c6fefbc223 Rename: intention tests "ifNullToElvis" --> "foldInitializerAndIfToElvis" 2016-10-11 16:13:16 +03:00
Mikhail Glukhikh 0903402282 "If null to elvis" now converts to elvis also !is check right after initializer #KT-14032 Fixed 2016-10-11 16:13:11 +03:00
Mikhail Glukhikh 121f0ec810 KT-14032 related: if expression to elvis now handles also is and !is checks 2016-10-11 16:13:06 +03:00
Mikhail Glukhikh 8188bb1e54 Destructure intention: entries / entrySet are now removed only for kotlin.Map inheritors #KT-14244 Fixed 2016-10-11 16:13:01 +03:00
Mikhail Glukhikh 304f6a3b3a KT-13943 related: inspection is now always reported if manual destructuring is available 2016-10-11 16:12:56 +03:00
Mikhail Glukhikh 475d5548c4 Destructure intention now handles the case with manual destructuring inside #KT-13943 Fixed 2016-10-11 16:12:51 +03:00
Nikolay Krasko c7ba19696a Refactoring: stop calling deprecated method
(cherry picked from commit 083656c)
2016-10-11 15:35:44 +03:00
Nikolay Krasko 11f8c904c4 Refactoring: inline method + inline variable
(cherry picked from commit 7e0f100)
2016-10-11 15:35:43 +03:00
Nikolay Krasko bd2ddbafb3 Refactoring: call apply method without returning intermediate object
(cherry picked from commit a2f7e00)
2016-10-11 15:35:41 +03:00
Nikolay Krasko 78525ed7c6 Refactoring: make createCommand non-nullable
(cherry picked from commit 67cc9b5)
2016-10-11 15:35:40 +03:00
Nikolay Krasko f7813263ee Refactoring: rename getStepOverPosition -> getStepOverAction
(cherry picked from commit 2b71909)
2016-10-11 15:35:38 +03:00
Denis Zharkov 194853b5c2 Fix backend issue related to JvmStatic val with accessor
Do not treat accessors to JvmStatic properties as having dispatch receiver

 #KT-11585 Fixed
2016-10-11 12:22:03 +03:00
Denis Zharkov 543cf7b265 Minor. Move isJvmStatic* functions to backend 2016-10-11 12:22:03 +03:00
Alexey Andreev 30c2c85c94 KT-13830: support case when LHS of augmented assignment is something different than qualified expression or array access 2016-10-11 11:54:04 +03:00
Yoshinori Isogai afe8244183 KT-14241 Add Intention + Inspection to remove empty class body (#968) 2016-10-10 19:24:39 +02:00
Ilya Gorbunov 4236a4dd07 Farewell, excluded imports from the platform. If anyone ever needs them again, they are buried in this commit. 2016-10-10 20:14:32 +03:00
Ilya Gorbunov f2c5fee1cf Consider only direct children of non-kotlin default imported packages when looking for aliased types. 2016-10-10 20:14:32 +03:00
Ilya Gorbunov 3baf2f8942 Use fully-qualified references to exceptions in kotlin-runtime 2016-10-10 20:14:32 +03:00
Ilya Gorbunov 7e2e2b9f19 Use effectively excluded imports from file's module descriptor. 2016-10-10 20:14:32 +03:00
Ilya Gorbunov ff01b3d41b Search java.lang aliases also in kotlin.text package (for aliases to Appendable and StringBuilder) 2016-10-10 20:14:32 +03:00
Ilya Gorbunov 5042158df5 Determine automatically which types from java.lang is aliased in default imported kotlin packages and exclude them from imported java.lang.* scope. 2016-10-10 20:14:32 +03:00
Zalim Bashorov 45d42bdff8 JS: add inspection for the case when something with dynamic type implicitly casted to kotlin another type 2016-10-10 17:30:51 +03:00