Commit Graph

32554 Commits

Author SHA1 Message Date
Nikolay Krasko dcfb5f1554 Minor: mark folder as resources not a source root 2016-07-07 02:51:24 +03:00
Alexey Tsvetkov 03b4eba4ef Remove dependency on Files from guava 2016-07-06 16:39:08 +03:00
Alexey Tsvetkov 16b1616ebc Gradle: copy kotlin classes after java compilation
#KT-9392 fixed
    #KT-12295 fixed
    #KT-12736 fixed
2016-07-06 16:38:48 +03:00
Denis Zharkov 3a59e1d222 Support suspending extension functions 2016-07-06 15:25:19 +03:00
Denis Zharkov 2cc09f928e Allow suspend extensions for specially annotated controllers 2016-07-06 15:25:19 +03:00
Denis Zharkov 30b4dfa65d Minor. Make extension's receiver to be a type parameter and simplify usage 2016-07-06 15:25:19 +03:00
Dmitry Petrov 3445fe0d30 KT-12985 Do not create range instances for 'for' loop in CharSequence.indices 2016-07-06 12:50:41 +03:00
Dmitry Petrov 3dc23a0e02 KT-12983 java.lang.VerifyError: Bad type on operand stack in arraylength
Use proper receiver value type.
2016-07-06 09:59:00 +03:00
Michael Bogdanov 6b8e8cee17 Fix for KT-12891: Allow to omit type in local delegated property declaration
#KT-12891 Fixed
2016-07-05 21:22:48 +03:00
Alexander Udalov 191dfa1f2b Minor, add test that language feature settings are used in local analysis
This test checks that the correct LanguageFeatureSettings instance (not
LanguageVersion.LATEST) is being passed to
createContainerForLazyLocalClassifierAnalyzer
2016-07-05 19:54:16 +03:00
Alexander Udalov b557f9e712 Fix typo in inline property diagnostic message 2016-07-05 19:25:24 +03:00
Alexander Udalov d331b6ae8e Minor, move isInfixCall implementation out of InfixCallChecker 2016-07-05 19:23:21 +03:00
Alexander Udalov 9bf91e95d0 Change default visibility for TypeAlias from 'internal' to 'public'
Since public type aliases will supposedly be more common than internal ones, it
makes sense to save on writing flags for the former rather than the latter
2016-07-05 18:18:45 +03:00
Alexander Udalov a48e1680e9 Minor, fix typo in KParameter#isOptional kdoc 2016-07-05 18:18:44 +03:00
Alexander Udalov 3b349e9be0 Fix reflection on reference to generic property
See a93484b457 for the similar fix to function
references

 #KT-12967 Fixed
2016-07-05 18:18:43 +03:00
Alexander Udalov 48fe9fb2c0 Fix AssertionError in OverrideResolver on bad hierarchy
Previously the code was operating under the assumption that if the
implementation of some function (both the implementation and the function come
from supertypes) does not have a proper return type (the one which is a subtype
of return type of all declarations of this function in the supertypes), then
there's necessarily at least one abstract declaration of the function, such
that the implementation's return type is not a subtype of the return type of
that declaration. The assertion makes sense when the hierarchy above the
current class does not have any errors: we should report at least one function
as being "not implemented" in the current class.

However, as demonstrated by the test case, if there's an error already in the
supertypes with regard to overridability of members, this assertion may be
wrong. Reporting the "not implemented" error in such case is in fact not
necessary because of the already existing error ("return type mismatch" in the
test) in the supertypes

 #KT-12482 Fixed
2016-07-05 18:18:43 +03:00
Alexander Udalov a533f8597d Fix debug names for some slices
Also move RUNTIME_ASSERTION_INFO and LOAD_FROM_JAVA_SIGNATURE_ERRORS to a
single class for simplicity
2016-07-05 18:18:26 +03:00
Denis Zharkov a420fda825 Fix problem with missing handleResult call
At first we try to resolve 'handleResult' just as last expression
in a lambda is first argument, then if results are unsuccessful
try resolve 'handleResult' with fake Unit expression

 #KT-12969 Fixed
2016-07-05 15:36:06 +03:00
Denis Zharkov 888db4b3b5 Make 'controller' field package-private
To make it accessible from nested lambdas

 #KT-12974 Fixed
2016-07-05 15:36:06 +03:00
Denis Zharkov d657bc8110 Treat any coroutine as it has non-const closure
Because it's always does capture controller
2016-07-05 15:36:06 +03:00
Denis Zharkov df4bf61378 Refine types returned by OptimizationBasicInterpreter.newValue
#KT-12958 Fixed
2016-07-05 15:36:06 +03:00
Denis Zharkov 17a41ecc79 Revert 1431e2a0: Fix variables spilling for coroutines
Tracking variable type in table is unnecessary after variables liveness introduction:
values having types conflicting with table should be dead
2016-07-05 15:36:06 +03:00
Dmitry Jemerov 58378c074d fix compilation 2016-07-05 13:56:12 +02:00
Kirill Rakhman 79fff4aa3c Show quick doc for implicit lambda parameter 'it' (#889)
* Show quick doc for implicit lambda parameter 'it'
Fixes #KT-9271

* Remove useless code
2016-07-05 14:51:56 +03:00
Dmitry Jemerov a770fe2ec8 fix test 2016-07-05 13:43:19 +02:00
Kirill Rakhman b50176fa2e Implement quickfix for wrong primitive literal (#885)
* Implement quickfix for wrong primitive literal
Fixes: KT-12251

* fix style issue
2016-07-05 14:34:14 +03:00
Kirill Rakhman 3b290ce3dd Add quickfix for "Illegal usage of inline parameter" that adds noinline (#888)
Fixes #KT-12838
2016-07-05 13:13:14 +03:00
Yoshinori Isogai 68dd3dde59 Change contributing section of "this query" link to finding open Kotlin issues (#891) 2016-07-05 01:09:49 +03:00
Ilya Gorbunov 5891aa0c5e Improve Standard Library changelog for 1.1-M1 2016-07-04 21:21:25 +03:00
Valentin Kipyatkov 5e48b7349e KT-12803 Unused import when class is used in method reference
#KT-12803 Fixed
2016-07-04 20:49:40 +03:00
Valentin Kipyatkov 1941572717 KT-10433 Copy-pasting reference to companion object member causes import dialog in specific case
#KT-10433 Fixed
2016-07-04 20:49:40 +03:00
Valentin Kipyatkov 9463880c4e KT-12646 ConvertToBlockBody intention should use BodyResolveMode.PARTIAL
#KT-12646 Fixed
2016-07-04 20:49:40 +03:00
Denis Zharkov 62e69af53c Report declaration that was being analyzed when internal error happened
#KT-12188 Fixed
2016-07-04 18:16:06 +03:00
Denis Zharkov ea7496044e Minor. Move KotlinFrontEndException to frontend module 2016-07-04 18:16:06 +03:00
Denis Zharkov 60a0cd8cfd Do not add error types as upper bounds in type parameter
#KT-10237 Fixed
 #KT-11821 Fixed
 #KT-8200 Fixed
2016-07-04 18:16:05 +03:00
Denis Zharkov 7723a3a105 Refine definition of whether single parameter the method should be boxed
Only 'Collection<Int>.remove(E): Boolean' should match
2016-07-04 15:44:00 +03:00
Denis Zharkov adff666b0e Introduce additional overridability rule
It works only for Java methods and it's purpose is Java overridability rules emulation,
namely distinction of primitive types and their wrappers.

For example `void foo(Integer x)` should not be an override for `void foo(int x)`

 #KT-11440 Fixed
 #KT-11389 Fixed
2016-07-04 15:44:00 +03:00
Denis Zharkov 082c4f971e Minor. Extract overridability rule into separate method 2016-07-04 15:44:00 +03:00
Denis Zharkov 167882df5d Temporary return BuiltinOverridabilityCondition class
Otherwise bootstrap problems appear
2016-07-04 15:44:00 +03:00
Denis Zharkov dc713cda2c Rename: BuiltinOverridabilityCondition -> JavaIncompatibilityRulesOverridabilityConditionBuiltinOverridabilityCondition 2016-07-04 15:44:00 +03:00
Denis Zharkov 6284598eff Minor. Fix comment 2016-07-04 15:44:00 +03:00
Alexander Udalov b44f060ffa Do not consider fake variables for objects in :: resolution
The main change is in
NewResolutionOldInference.ResolutionKind.CallableReference, where
createVariableProcessor creates a processor which no longer lists objects

 #KT-12322 Fixed
2016-07-04 15:42:35 +03:00
Alexander Udalov f290f1be68 Initial support of type inference for callable references
There are two main changes here:

- In CallCompleter, there was a bug: we assumed that the return type of a
  candidate must be a subtype of the expected type and were adding a
  corresponding constraint to the system. However, this is not true for
  callable references where the type of the expression is KFunctionN<...> and
  the return type of the candidate must be a subtype of the _last generic
  argument_ of the functional type.
- In CandidateResolver, we use a more correct (although still not precise)
  heuristic to determine if a candidate fits based on the non-substituted type
  of the callable reference expression which it would produce.

This can be further improved, see TODOs in CallCompleter. Also this does not
influence resolution of callable references being passed as arguments to
generic calls (that happens in GenericCandidateResolver)

 #KT-10968 Fixed
 #KT-11075 Fixed
 #KT-12286 Fixed
 #KT-12963 Open
 #KT-12964 Open
2016-07-04 15:42:35 +03:00
Alexander Udalov 24682bf1ec Fix AssertionError on property generation in multi-file classes
See 4a533168d9 for the original change which
introduced the problem

Note that the added test case _was not failing_ before the change. It's added
because there were no tests on multi-file class behavior in light classes mode
at all. The actual repro for the problem is difficult to make a test from

 #KT-12755 Fixed
2016-07-04 15:42:35 +03:00
Alexey Andreev 80deebbc2a Fix configuration of maven test of moduleKind configuration property 2016-07-04 14:56:45 +03:00
Alexey Andreev 88eef7337e KT-12928: decompose invocation like "a.foo(b)" to "$t = a; $s = $t.foo.bind($t); $s(b)" instead of "$t = a.foo; $t(b)", since in the latter case foo won't receive proper this. Add optimization that replaces "foo.bar.bind(baz)(args)" with "baz.bar(args)" 2016-07-04 14:52:12 +03:00
Dmitry Petrov 07cb3e09b9 KT-11892: explicitly qualified 'super' with a supertype that is overridden
by a different explicitly declared supertype is an error (as in Java)
(see http://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.12.3)
2016-07-04 13:53:49 +03:00
Dmitry Petrov dbf38823b9 Minor: use NoLookupLocation.WHEN_GET_SUPER_MEMBERS
for unqualified 'super' resolution
2016-07-04 13:53:49 +03:00
Dmitry Petrov bf4f26318e KT-6916: do not create Progression instances in for-in-downTo loops 2016-07-04 13:38:37 +03:00
Dmitry Petrov e187f799d9 Minor: extract optimized loop codegen creation logic for optimized 'for' cases.
There will be some more of those, and they all require some ad hock processing.
2016-07-04 13:38:36 +03:00