Commit Graph

38701 Commits

Author SHA1 Message Date
Yan Zhulanow 63243b99fa Kapt3: Check if the 'tools.jar' is present in the plugin classpath (KT-17456)
Kapt3 won't work without the 'tools.jar' file provided, but we shouldn't throw an exception in this case.
This commit adds the warning message (and disables Kapt if it can't be used).
2017-04-27 18:52:10 +03:00
Yan Zhulanow 20e362e363 Kapt3: Do not generate "options not recognized" for "kapt.kotlin.generated" option (KT-17418)
"kapt.kotlin.generated" AP option is always present (and it's the way to say the arbitrary processors about the target directory for generated Kotlin source files).
In this commit, the "fake" empty annotation processor is added to consume the option if no other processor does it.
2017-04-27 18:52:09 +03:00
Denis Zharkov c970763a7f Fix callable reference resolution regression
The regression appeared after
b5a8ffaddc
when we started trying both static and member methods until
first success and when there is no successful
we were just leaving the last one (e.g. private member)

But the actual problem is that we were commiting the trace
in case of single (but incorrect) result in resolution mode of
SHAPE_FUNCTION_ARGUMENTS when we couldn't yet choose the
correct static method

Also we shouldn't choose a shape for callable reference
using only the knowledge that result is single:
it may lead to the wrong inference result
(see test with Pattern::compile)

 #KT-17597 Fixed
2017-04-27 18:38:10 +03:00
Mikhail Glukhikh 4b6667f599 Make IntentionBasedInspection deprecated 2017-04-27 18:21:39 +03:00
Mikhail Glukhikh bb8091a6ca KT-17503 add check whether callable reference is acceptable in lambda 2017-04-27 18:21:33 +03:00
shiraji 0eceef1519 Add inspection to detect use of callable reference as a lambda body
So #KT-17053 Fixed
2017-04-27 18:21:27 +03:00
Mikhail Glukhikh 53e11cbeb5 Create test group: AbstractLocalInspectionTest
Goal is to have inspection tests that work on per-file per-case basis
Test group allow both inspection message control and local fixes control
2017-04-27 18:21:15 +03:00
Simon Ogorodnik de66f76299 Fix regression of sample resolution in library sources
Use hack to answer package questions
 #KT-17448 fixed
2017-04-27 16:53:07 +03:00
Ilya Gorbunov 99504eb753 Support rendering receiver parameters
Otherwise generated coroutine implementation class could not be rendered since one of its members corresponds to receiver parameter descriptor.
2017-04-27 16:38:25 +03:00
Vyacheslav Gerasimov 5f09e18394 Fix Android api issues reporting for generic collection method calls
#KT-16712 Fixed
2017-04-27 16:02:37 +03:00
Vyacheslav Gerasimov 9552666aa6 Use platform-25 for android tests
Add Android platform-25 to dependencies
Update platform tools to 25.0.3
2017-04-27 16:02:37 +03:00
Mikhail Zarechenskiy 7af10769c9 Enable control flow checks for functions without body
Except checks for tail recursive calls

 #KT-7796 Fixed
2017-04-27 15:50:18 +03:00
Mikhail Zarechenskiy a0d7b703f4 Align generic signature for inner classes to work as in Java
#KT-10397 Fixed

According to JVMS (p. 4.3.4) inner classes should be separated with `$` in generic signature.

Note that in Java, inner types separated with `.` after first parameterized type, and now we preserve the same behaviour. See tests for clarification.
2017-04-27 15:47:28 +03:00
Mikhail Glukhikh 14e798a1fc Take imported from object descriptor into account in pseudocode
So #KT-15566 Fixed
2017-04-27 15:27:41 +03:00
Alexander Udalov 056eebf69c Update list of excluded directories in root module 2017-04-27 12:38:01 +03:00
Ilya Matveev 935d42f8ac Ignore explicitEqualsOnDouble.kt box-test for native backend 2017-04-27 14:55:32 +07:00
Dmitry Jemerov 75a1e8f0a2 Don't show hint for parameter with explicitly specified type 2017-04-26 18:23:45 +02:00
Dmitry Jemerov 7973e033a9 Initial tests for type hints; don't show hint when type is obvious 2017-04-26 18:23:41 +02:00
Dmitry Jemerov d1cdd6d8ed Separate logic for argument name hints and type hints 2017-04-26 18:23:16 +02:00
Dmitry Jemerov 108e97b70e Show parameter hints for ambiguous calls 2017-04-26 18:21:19 +02:00
Dmitry Jemerov 26445397bb Add varargs tests; show ... before vararg arguments 2017-04-26 18:09:13 +02:00
Dmitry Jemerov c9639f6ae0 Port some Java tests for parameter hints; fix detected issues
Show hints for string templates; correctly apply blacklist for
constructor calls
2017-04-26 18:09:13 +02:00
Dmitry Jemerov 760e43d4f1 Include in MethodInfo only names of arguments actually in the call
Needed to apply blacklist for e.g. startsWith more correctly.
2017-04-26 18:09:13 +02:00
Dmitry Jemerov aad79f4d63 Fix blacklist application by returning parameter names correctly 2017-04-26 18:09:13 +02:00
Dmitry Jemerov d8f16c0464 Disable inlay type hints by default 2017-04-26 18:09:12 +02:00
Dmitry Jemerov 6cda992204 Separate options for showing types of local vars and properties 2017-04-26 18:09:12 +02:00
Dmitry Jemerov 0132b643ec Show function return type hint in the end of parameter list 2017-04-26 18:09:12 +02:00
Dmitry Jemerov 8508b8b397 Show parameter hints only before unclear expressions, as in Java 2017-04-26 18:09:12 +02:00
fitermay 8b3f8ce750 Inlay param/type support for kotlin 2017-04-26 18:09:12 +02:00
Vyacheslav Gerasimov 49c8dfbb06 Add gutter icons for Android resource references
#KT-16843 Fixed
2017-04-26 18:38:29 +03:00
Vyacheslav Gerasimov 386ec53dd5 Update AndroidTestCase to AS 2.3 + Android tests refactoring 2017-04-26 18:38:29 +03:00
Alexander Udalov e2c62cbded Support serialization of built-in ranges as error types
This will be needed to move ranges and progressions out of builtins.
Currently they're only used in signatures of "rangeTo" functions on
primitives
2017-04-26 18:10:54 +03:00
Alexander Udalov f648f0235c Move ErrorUtils.ErrorTypeImpl to top level ErrorType and J2K 2017-04-26 18:10:53 +03:00
Alexander Udalov 38ea9986ab Make KotlinType.isError extension instead of member 2017-04-26 18:10:49 +03:00
Mikhail Glukhikh 787a32f4f1 KT-17408 related: fix of two broken tests 2017-04-26 17:31:46 +03:00
Stanislav Erokhin dce373b807 Create special data flow info for ControlStructure. It will be used in new inference for special calls. 2017-04-26 13:47:53 +03:00
Stanislav Erokhin dbe867e2c0 Minor. Change upper bound for collection of given candidates. 2017-04-26 13:47:52 +03:00
Stanislav Erokhin 1af733da05 Added isAllowedTypeVariable inside KotlinTypeChecker 2017-04-26 13:47:51 +03:00
Stanislav Erokhin 53ccfcf195 Add util functions getKPropertyType for both receivers and isNumberedKFunction 2017-04-26 13:47:50 +03:00
Stanislav Erokhin 22e667ad65 Removed generic hell from tower resolver 2017-04-26 13:47:49 +03:00
Stanislav Erokhin 863b9f7603 Minor. Change parameter type from Set to Collection. 2017-04-26 13:47:48 +03:00
Stanislav Erokhin 83a82cdd04 Refactoring. Remove descriptor from resolution Candidate. 2017-04-26 13:47:47 +03:00
Zalim Bashorov 794e65b5d6 KJS: remove Rhino library 2017-04-26 13:07:35 +03:00
Zalim Bashorov fb1c4320b6 KJS: check hashCode property only for objects to avoid extra boxing for primitive values
Also in Nashorn everything has hashCode including primitive types,
so the result can be different at Nashorn and at other engines.
2017-04-26 13:07:34 +03:00
Zalim Bashorov 678d2e7c21 KJS: transform labeled blocks to labeled do-while
It's a workaround for JDK-8177691.
Such code can appear during inline.
2017-04-26 13:07:33 +03:00
Zalim Bashorov 76fa6ad5c2 KJS: switch to using Nashorn instead of Rhino for JS backend tests 2017-04-26 13:07:30 +03:00
Dmitry Petrov a39a0abb2a Traverse store-load chains for POP instructions
POP instructions can be only live usages for functional parameters,
e.g., when corresponding invoke is in dead code (KT-17591).
2017-04-26 12:42:45 +03:00
Dmitry Petrov fe571a7dfa Normalize local returns before other inlining transformations
Local returns normalization can generate POP instructions.
These POP instructions can drop functional parameters, as in KT-17590,
and should be processed in markPlacesForInlineAndRemoveInlinable just
as other POP instructions.

KT-17590 conditional return in inline function parameter argument causes compilation exception
2017-04-26 12:42:33 +03:00
Dmitry Petrov 996a08a3f7 Add tests with loop in store-load chains on noinline function parameters 2017-04-26 12:42:33 +03:00
Dmitry Petrov e1731373d8 Do not restore stack in default handler for try-finally
It never terminates, so the corresponding value on stack can't be used.
However, if this happens in an inlined lambda argument, the inliner is
unable to remove the corresponding ALOAD instruction (because default
handler never terminates, and thus corresponding ALOAD is not used for
lambda invocation).

KT-17573 try-finally expression in inlined function parameter argument fails with VerifyError
2017-04-26 12:42:33 +03:00