Commit Graph

32517 Commits

Author SHA1 Message Date
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
Dmitry Petrov d45330c184 Fix CCE when typealias is used in a class reference ('TA::class') 2016-07-04 08:52:09 +03:00
Dmitry Petrov 5dfbaede4f Typealias can't be a qualifier 2016-07-04 08:30:18 +03:00
Dmitry Petrov c8a5ccb1d0 "Go to class / symbol / super" & type aliases 2016-07-04 08:30:18 +03:00
Dmitry Petrov 0033cf85c4 Shorten references tests for typealias. 2016-07-04 08:30:18 +03:00
Dmitry Petrov 075195a3e4 Provide base icon for type alias descriptor.
Use platform icon for a class (as we do for type parameters).
2016-07-04 08:30:18 +03:00
Zalim Bashorov 48617caacc JS: generate a function with the required name for callable references instead try to change the name later. The previous solution doesn't work properly on some JS VMs (e.g. in FireFox)
#KT-12929 Fixed
2016-07-01 21:13:15 +03:00
Ilya Gorbunov 919c099a95 Minor: make test output less verbose 2016-07-01 18:50:53 +03:00
Ilya Gorbunov 157ed3f8c1 Claim a stream produced from a Sequence having ORDERED property.
Add a test verifying that property is respected.
2016-07-01 18:06:54 +03:00
Ilya Gorbunov 22ee3a8dc1 Relax type parameter constraint for Closeable.use and AutoCloseable.use to allow nullable receiver.
#KT-12894 Fixed
2016-07-01 18:05:25 +03:00
Ilya Gorbunov e04873957e Notes in README about required environment variables to build libraries maven project. 2016-07-01 18:05:24 +03:00
Ilya Gorbunov dd0ecb5ece Adjust exposed visibility of platform specific implementations. 2016-07-01 18:05:23 +03:00
Ilya Gorbunov a45da393b9 Provide access to named groups of regex match result on JDK8.
#KT-12753 Fixed
2016-07-01 18:05:22 +03:00
Ilya Gorbunov 25974be3f8 Provide specialized stdlib function implementations depending on current JRE version #KT-8254 2016-07-01 18:05:21 +03:00
Ilya Gorbunov b16f46d932 Add extensions from kotlinx.support libraries:
use for AutoCloseables: #KT-5899,
extensions for java.util.Stream.
2016-07-01 18:04:42 +03:00
Ilya Gorbunov d6261521ff Create new artifacts for standard library extensions for JRE7 and JRE8.
Set default JDK for kotlin compiler plugin.
Set default JRE path for maven surefire plugin.
Run tests for extension modules on the corresponding JRE.
#KT-8254
2016-07-01 16:49:13 +03:00
Ilya Gorbunov 17e7c269ad Minor: make tryInlined test not depend on 'Closeable.use' implementation. 2016-07-01 04:42:38 +03:00
Stanislav Erokhin 24ad167b9d Update changelog for 1.1-M01. 2016-06-30 23:46:09 +03:00
Ilya Chernikov 3bc826a542 Update changelog - add scripting part 2016-06-30 21:32:42 +02:00
Ilya Chernikov d345d2bc95 Reduce GradleScriptTemplateProvider dependency from gradle plugin, add missing pieses to it's environment
Fixes #KT-12913
2016-06-30 21:32:41 +02:00
Ilya Chernikov 55e084db8e Refactor script resolving interface again
- remove Future from resovler since the idea need additional considerations
- simplify script contents interface
 -extend script dependencies with additional javaHome property
2016-06-30 21:32:40 +02:00
Ilya Chernikov dfec16d8e0 Refactor script resolving interface
- return Future from resovler
- pack script contents data to a separate interface
 -extend script dependencies with additional scripts property
 - minor renames and moves
2016-06-30 21:32:39 +02:00
Ilya Chernikov 4cd8101bad minor: rename depends annotation in script tests, add it to implicit imports 2016-06-30 21:32:38 +02:00
Ilya Chernikov 2ca4d635ea Support backward compatibility with gradle-script-kotlin 0.2.0, some refactoring 2016-06-30 21:32:37 +02:00
Alexander Udalov 1690dcd8df Refactor FakeCallResolver and usages
Remove useless overload, inline another to the single usage in tests, make some
parameters non-null
2016-06-30 21:29:23 +03:00
Alexander Udalov 95ed3ed78b Minor, remove unused components in ForLoopConventionsChecker
This is an addition to 8357f30
2016-06-30 21:29:23 +03:00
Denis Zharkov 1c3db309e5 Support repeated 'invoke' calls on coroutines defined within inline lambdas
#KT-12782 Fixed
2016-06-30 20:22:39 +03:00
Denis Zharkov ae46c726fc Add try/catch block around method transformations 2016-06-30 20:22:39 +03:00
Denis Zharkov c2ac49ec96 Support repeated 'invoke' calls on coroutines
#KT-12782 In Progress
2016-06-30 20:22:39 +03:00
Denis Zharkov a25602c709 Fix spilling algorithm for double-sized coroutine parameters 2016-06-30 20:22:39 +03:00
Denis Zharkov 84964a76f9 Move generation of coroutines 'invoke' after 'doResume'
It's necessary because in next commits 'invoke' will depend on captured variables
that are being calculated during 'doResume' calculation
2016-06-30 20:22:39 +03:00
Alexey Tsvetkov d3461d1519 Fix shading of META-INF/services in kotlin-compiler-embaddable 2016-06-30 20:14:21 +03:00
Denis Zharkov 9efd50c49c Minor. Cleanup getSpecialBridgeSignatureIfExists 2016-06-30 20:13:07 +03:00
Denis Zharkov bb537aa834 Simplify method contract and add assertion
We don't generate stubs for final built-ins anyway
(as well as special bridges)
2016-06-30 20:12:34 +03:00
Denis Zharkov 84eb009c29 Refine stubs generation for special built-ins
Do not generate stub if declaration has the same signature

 #KT-12909 Fixed
2016-06-30 20:12:34 +03:00
Denis Zharkov 5c34b27ea9 Fix stub generation for special built-ins
Do not generate stubs if there is no special bridge in the current class
- there are already Kotlin super class in hierarchy
- special bridge has the same signature as method itself

 #KT-11915 Fixed
2016-06-30 20:12:34 +03:00
Alexander Udalov c07d0d48d3 Fix KCallable#callBy to JvmStatic companion object members
#KT-12915 Fixed
2016-06-30 19:41:47 +03:00
Nikolay Krasko e2bcdf8b9c Postpone counting fqName for anonymous classes (KT-12645)
#KT-12645 Fixed
2016-06-30 15:54:59 +03:00