Commit Graph

39680 Commits

Author SHA1 Message Date
Mikhail Zarechenskiy e40c8fff05 Make resolution status name more precise 2017-06-22 13:50:01 +03:00
Mikhail Zarechenskiy 7a9e1b2b1d Improve diagnostic on overload resolution ambiguity
Report type mismatch on argument when a nullable argument is passed to non-null parameter.

 Note that this affects only functions with simple types without generics

 #KT-2007 Fixed
 #KT-9282 Fixed
2017-06-22 13:41:31 +03:00
Mikhail Zarechenskiy 16de991b07 Add test for obsolete issue
#KT-8262 Obsolete
2017-06-22 13:41:30 +03:00
Mikhail Zarechenskiy 4b3ffd9418 If all candidates are invisible then don't report ambiguity
#KT-10045 Fixed
2017-06-22 13:41:28 +03:00
Mikhail Zarechenskiy cd1ae7f0f2 Add resolution status to report about unsuccessful smartcast
#KT-10248 Fixed
 #KT-11119 Fixed
2017-06-22 13:41:27 +03:00
Mikhail Zarechenskiy 0f4497256b Report about wrong number of type arguments instead of ambiguity
#KT-7975 Fixed
 #KT-1809 Fixed
2017-06-22 13:05:10 +03:00
Dmitry Jemerov 24f1bbfb46 Add code for configuring eap-1.2 bintray repo
#KT-18316 Fixed
2017-06-22 11:01:03 +02:00
Dmitry Petrov 2b3043bf9f Fix CFG problem for 'when' in Konan
If type of 'when' expression is 'Nothing', it should be kept that way
even if the expression itself is implicitly coerced to Unit.
2017-06-22 10:21:54 +03:00
Alexander Udalov 1f34dfabd5 Use kotlin.Lazy for script definition computation, add test for no definition 2017-06-22 10:19:06 +03:00
Ilya Chernikov 4178188e15 Fix name retrieval on exception reporting during analysis 2017-06-22 10:19:05 +03:00
Alexander Udalov 135f0a136e CLI: report error if the first argument for "-script" is not kts
#KT-3045 Fixed
2017-06-22 10:19:05 +03:00
Alexander Udalov 85d1bef351 Add reflection.jvm module sources to kotlin-reflect library
To be able to debug classes in kotlin-reflect via reflection.jvm's
sources when running tests
2017-06-22 00:08:38 +03:00
Alexander Udalov a064b59a7d Do not put "Class-Path: kotlin-stdlib.jar" into kotlin-reflect manifest
Since the kotlin-reflect artifact might be used in environments where
the kotlin-stdlib artifact is named something else (e.g.
kotlin-stdlib-{version}.jar) and the file existence is verified by the
launcher

 #KT-16399 Fixed
2017-06-22 00:08:38 +03:00
Dmitry Jemerov 2407f8b9ac Add collection building methods to default blacklist
#KT-18030 Fixed
2017-06-21 19:09:23 +02:00
Dmitry Jemerov 16c8a092ca Correctly show parameter name hints for non-ambiguous overloads 2017-06-21 19:09:21 +02:00
Nikolay Krasko ad6c84924b Copy bootstrap compiler to dist directory
Can by used in old branches where it's impossible to make dist properly
2017-06-21 17:51:51 +03:00
Nikolay Krasko 3ffd63a17c Attempt for fix flaky debugger tests - wait for the resume before exit 2017-06-21 17:49:03 +03:00
Alexander Udalov 233b63469a Fix IllegalAccessException on private annotation in reflection
#KT-14094 Fixed
2017-06-21 15:43:00 +03:00
Alexander Udalov fb60f4ad8f Do not load annotations of each function in JvmBuiltInsSettings.isFunctionAvailable
This fixes the exception in the case described in KT-14094 because we no
longer try to load annotations on functions which cannot be annotated
with @PlatformDependent. (However, the underlying problem in KT-14094 is
not fixed by this, and is still reproducible on explicit call to
KCallable.annotations.)

 #KT-14094 In Progress
2017-06-21 15:43:00 +03:00
Alexander Udalov 6388c1885c Fix KCallable.call for protected members from base class
Class.getMethod does not return protected methods from super class, so
we invoke getDeclaredMethod on each super class manually instead

 #KT-18480 Fixed
2017-06-21 15:42:59 +03:00
Alexander Udalov a25aa2fed8 Cleanup DefaultErrorMessagesJvm
Use static imports, use Kotlin stdlib API, use more precise renderers
2017-06-21 15:42:59 +03:00
Alexander Udalov 4e51448b66 Refactor and simplify functionTypes.kt and related code
Remove unused declarations, inline one-liners, optimize by using
KotlinBuiltIns.isUnderKotlinPackage
2017-06-21 15:42:58 +03:00
Alexander Udalov 5a25ba199a Micro optimization to avoid computing class FQ name when not necessary
KotlinBuiltIns.isConstructedFromGivenClass checks the simple name of the
class first, and only computes the full FQ name if it matches the last
segment of the expected FQ name
2017-06-21 15:42:57 +03:00
Alexander Udalov aed5b934f8 Introduce KotlinBuiltIns.isUnderKotlinPackage
Semantics is the same as in the former
FunctionDescriptor.hasSubpackageOfKotlin, but it doesn't compute the FQ
name of the descriptor
2017-06-21 15:42:57 +03:00
Alexey Sedunov 7bc42f89d3 Configuration: Fix API version selection on language version change 2017-06-21 12:36:53 +03:00
Alexey Sedunov 3460a31e3a Kotlin Facet: Do not import dependency-based classpath from Gradle
JPS obtains it automatically via imported module dependencies

 #KT-18475 Fixed
2017-06-21 12:36:52 +03:00
Alexey Sedunov f68689b5e4 Kotlin Facet: Do not import jdkHome from Gradle/Maven model
#KT-18151 Fixed
2017-06-21 12:36:51 +03:00
Alexey Sedunov fe42586c6f Kotlin Facet: Fix NPE in Maven importer tests
#KT-18376 Fixed
2017-06-21 12:36:50 +03:00
Alexey Sedunov 0570592952 Kotlin Facet: Avoid rewriting platform version with project settings
#KT-18373 Fixed
2017-06-21 12:36:49 +03:00
Ilya Chernikov 2e823a4816 Fix compatibility with renamed Gradle Kotlin DSL 2017-06-21 11:35:21 +02:00
Mikhail Zarechenskiy 1e020644e1 Fix getting right bracket element for collection literal 2017-06-21 01:22:08 +03:00
Mikhail Zarechenskiy 837df66c19 Register reference contributor for collection literals
#KT-18551 Fixed
2017-06-21 00:16:28 +03:00
Alexey Andreev 78b238a05b Report warning when two .kt files get same paths in JS source map 2017-06-20 17:40:36 +03:00
Alexey Andreev 60dd475493 Don't expose sourceMapSourceRoots argument to Gradle (JS)
Exposing this property causes IDEA to treat it as a free
command line argument, which is undesirable.
Support source roots via setting command line arguments inside
JS gradle task.
2017-06-20 17:40:35 +03:00
Alexey Andreev 49b742ab3d Add new JS source map config options to Maven plugin 2017-06-20 17:40:35 +03:00
Alexey Andreev cfd3b137d8 Add support for JS source map source roots to Gradle plugin 2017-06-20 17:40:34 +03:00
Alexey Andreev 62fb149f08 Add support for sourceMapPrefix option (JS) in IDEA 2017-06-20 17:40:34 +03:00
Alexey Andreev 1d6f01ee6c Add support for relative JS source map paths in JPS 2017-06-20 17:40:33 +03:00
Alexey Andreev 13ab63ae09 Generate relative paths in JS source maps
Also, add CLI options to manipulate prefixes of path

See KT-4078
2017-06-20 17:40:32 +03:00
Nikolay Krasko 44d3b8fb1a Ignore sub-queries for other operators with the same receiver (KT-18566)
ExpressionsOfTypeProcessor searches for all occurence of expression
with given type. It start from usages of the class, searches for sub-classes,
declarations that return those classes, usages of these declarations,
and so on.

During this search, find usages for all operators that return the
subject type is executed as sub-queries. Full search for such queries
can't give addition types. And it also shouldn't give additional scopes
for search, because same scopes should be located by operands. In other
words, if sub-query can spot the scope of usage starting from the same
type, the original query should also process same scope.

 #KT-18566 Fixed
2017-06-20 16:53:05 +03:00
Yan Zhulanow 0f3dff44ac Minor: Remove invalid Maven module reference 2017-06-20 15:23:15 +03:00
Alexander Udalov 31b2fffbe1 Avoid NPE at UtilKt.toJavaClass for unrecognized classes
Sadly, the case where this NPE would reproduce, remains unknown

 #KT-18494 Fixed
2017-06-20 14:39:48 +03:00
Alexander Udalov 8ef3531c48 Add kotlin.Any to KClass.superclasses if it's absent
#KT-18476 Fixed
2017-06-20 14:39:48 +03:00
Alexander Udalov 9471f33c38 Refactor getDefaultSupertype, drop obsolete diagnostic 2017-06-20 14:39:47 +03:00
Alexander Udalov 90f2ea87a6 Fix exception on callBy of callable with more than 32 parameters
The previous condition that checked if we'd skipped any optional
parameters didn't work when number of parameters > 32 because the number
of bit masks in that case was more than one

 #KT-18404 Fixed
2017-06-20 14:39:47 +03:00
Mikhael Bogdanov 62cd57b0d2 Make base test classes 'abstract' 2017-06-20 13:07:30 +02:00
Dmitry Petrov 786ac46fa6 Do not store nulls for captured variables going out of scope
These values can't be read after going out of scope.
JVM implementation can take care of such object references on its own.
Ref objects for captured variables are not different from any other
objects stored in local variables, so there's really no reason to
nullify these references explicitly.

 #KT-18478 Fixed Target versions 1.1.4
2017-06-20 13:31:36 +03:00
Dmitry Petrov 9356c1e0ef Skip PopBackwardPropagation for methods with large frames or no POPs
TODO get rid of SourceInterpreter here, it's quite expensive.
2017-06-20 13:31:36 +03:00
Dmitry Petrov 0a622e4440 Rewrite OtherOrigin overloads to prevent further silly problems
#KT-18413 Fixed Target versions 1.1.4
2017-06-20 13:31:36 +03:00
Mikhael Bogdanov 8ca82c8e99 Add missed common parts 2017-06-20 11:08:53 +02:00