Commit Graph

40626 Commits

Author SHA1 Message Date
Dmitry Petrov a303888e66 [NI] Fix expected return type for function literals
It should actually be Unit, as told in FunctionExpression comments
(was null, later defaulted to Any?).
2017-08-07 18:00:09 +03:00
Dmitry Petrov 0136be3500 [NI] Fix traversing delegated constructor call chain
Use original descriptor instead of possibly substituted one: even though
the substitution is always trivial here, delegated constructor call is
recorded for the original constructor descriptor. So the code that
traverses the delegated constructor call chain should use original
descriptor, too.
2017-08-07 18:00:08 +03:00
Mikhail Zarechenskiy 0634025229 [NI] Propagate known type substitutor to resolution part
This commit fixes 'functionNtoStringGeneric' and 'superConstructor'
2017-08-07 18:00:07 +03:00
Mikhail Zarechenskiy c6fcbf6172 [NI] Check for unwrapped descriptor when generating accessible function
In new inference we get copy of sam constructor and therefore should check original descriptor in BE.

 This fixes 'protectedSamConstructor' test
2017-08-07 18:00:06 +03:00
Stanislav Erokhin e12eb66572 [NI] Fix COERCION_TO_UNIT in NI. 2017-08-07 18:00:05 +03:00
Stanislav Erokhin de17604fe7 [NI] Bind all new resolved calls before update arguments. 2017-08-07 18:00:04 +03:00
Stanislav Erokhin 42438bd363 [NI] Do not calculate lambda return type in Visitor if NI enabled. 2017-08-07 18:00:03 +03:00
Stanislav Erokhin 85248676d2 [NI] Update lambda result arguments after resolution. 2017-08-07 18:00:02 +03:00
Stanislav Erokhin b9e9243e9d [NI] Add hacks for property delegation resolution. 2017-08-07 18:00:00 +03:00
Stanislav Erokhin af138e7403 Minor. Extract object to inner class. 2017-08-07 17:59:59 +03:00
Stanislav Erokhin 5bb61d2d02 [NI] Small improvements in callable reference resolution.
I'm not sure in this commit, but it fix some test -> let it be for now.
And yes, now I do not know correct way for callable reference resolution,
so for now it is just proposals.
2017-08-07 17:59:58 +03:00
Stanislav Erokhin 7eabdeffb3 [NI] Fix variable to proper upper type even if direction is TO_SUBTYPE. 2017-08-07 17:59:57 +03:00
Stanislav Erokhin b3be21146c [NI] Add more hacks. 2017-08-07 17:59:56 +03:00
Stanislav Erokhin 0f0d834c23 [NI] Minor. Fix IOE. 2017-08-07 17:59:55 +03:00
Stanislav Erokhin 55181541af [NI] Change lambda analysis -- create arguments for return statements. 2017-08-07 17:59:54 +03:00
Stanislav Erokhin 58f73bd82a [NI] Use right DFI for arguments smart-casts. 2017-08-07 17:59:53 +03:00
Stanislav Erokhin 30f7396803 [NI] Substitute lambda return type with current substitutor
We should do this because return type even it still not proper
can contain fixed type variables
2017-08-07 17:59:52 +03:00
Stanislav Erokhin 89ac3bd5cf [NI] Do not add useless constraints to constraint system
Skipped constraints:
 - T <: Any, T >: Nothing
 - T <: T, T <: T?, T >: T, T <: T!, T! <: T
2017-08-07 17:59:51 +03:00
Stanislav Erokhin 3a25405088 [NI] Remove type variables for lambda arguments -- use existing instead. 2017-08-07 17:59:50 +03:00
Stanislav Erokhin ff6a28b64c Add util method to BuildIns is kotlin.Function type. 2017-08-07 17:59:49 +03:00
Stanislav Erokhin acc6e48172 [NI] Added isSuspend for lambdas. 2017-08-07 17:59:48 +03:00
Stanislav Erokhin 29e2a26ad6 [NI] Write fake ResolvedCall for callable reference. 2017-08-07 17:59:47 +03:00
Stanislav Erokhin ee16a79612 [NI] Add pre-resolution callable reference argument check.
If expected type for callable reference argument isn't callable type
then make such candidate unsuccessful.
Sometimes expected type is just `T`, where `T` is type variable.
To support such case we take all supertypes and check them instead.
2017-08-07 17:59:46 +03:00
Stanislav Erokhin 55dc2c11f7 [NI] Support callable reference resolution in NI.
Missing parts:
- report results about callable references into trace
2017-08-07 17:59:46 +03:00
Stanislav Erokhin 02f4558683 Add way to create callable reference processor
Priority of variables and function should be the same.
Because of this we create new CompositeSimpleScopeTowerProcessor,
which merge candidates for properties and function into one candidate group
2017-08-07 17:59:44 +03:00
Stanislav Erokhin 36ea9484a9 [NI] Minor. Extract code to function.
Also make KotlinCall unnecessary for TypeVariableFromCallableDescriptor.
2017-08-07 17:59:43 +03:00
Mikhail Zarechenskiy 0b358fb693 Fix collection literals resolve in gradle-based projects
#KT-19441 Fixed
2017-08-07 17:52:08 +03:00
Daniil Vodopian b24c1bf06c KT-9669: introduced JoinStatementAddSemicolonHandler; registered the handler in plugin.xml; added test coverage (#1232) 2017-08-07 16:20:40 +02:00
Dimach d624ed4aff KT-18482: "Move lambda argument to parenthesis" action generate uncompilable code fixed (#1226)
* KT-18482 fixed

* Moved code to separate method and changed code to cover few more cases.

* Code style fixes.
2017-08-07 15:43:44 +02:00
Alexey Andreev a4551fb0fb Fix infinite loop during continuous Gradle build including JS DCE
It's basically a workaround fox bug in Gradle.
See https://github.com/gradle/gradle/issues/2651
2017-08-07 16:36:57 +03:00
Sergey Igushkin 71878b2218 Merge pull request #1225 from nageshs/master
Close the local.properties file after reading
Issue #KT-19397 Fixed
2017-08-07 16:07:51 +03:00
Sergey Igushkin 13a2de1816 Update libraries/ReadMe.MD, add info about plugin markers required for tests 2017-08-07 15:14:37 +03:00
Sergey Igushkin 0cfac71efe (minor) Improve readability of pluginMarkers.gradle, fix indent in file
(minor) Clarify the comment on the setUpSeparateArtifact block
2017-08-07 14:33:35 +03:00
Sergey Igushkin 94036b7cac Add Gradle license 2017-08-07 14:33:33 +03:00
Sergey Igushkin 999db0bc80 Add a test for plugins DSL 2017-08-07 14:32:41 +03:00
Sergey Igushkin 8fd508566a Add Gradle plugin marker artifacts for the Gradle plugins.
This allows for the Gradle plugins DSL to resolve the plugins from
a custom repository.
https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers
2017-08-07 14:17:43 +03:00
Toshiaki Kameyama 64eeb479aa Take nullability annotations into account in QF correcting override
So Java NotNull annotated is converted to `Type`
and Java Nullable annotated to `Type?` accordingly

So #KT-19299 Fixed
2017-08-07 13:52:25 +03:00
Mikhail Glukhikh 1264ed7c86 Minor cleanup 2017-08-07 13:20:35 +03:00
Andrius Semionovas 666c241479 KT-19126 Add convert property initializer to getter in interfaces (#1224) 2017-08-07 11:53:37 +02:00
Kirill Rakhman 2536615e0e detect valid extension main functions (#1227)
Fixes #KT-18083
2017-08-07 11:39:34 +02:00
Yujin Jung 4c00119f08 Fix incorrect slack link (#1231) 2017-08-07 11:39:02 +02:00
Nikolay Krasko 7d66af6583 Always assign shebang comment to same position before package 2017-08-07 12:17:20 +03:00
Nikolay Krasko 8d226594ff Put comments and whitespaces under body in script files
It's more consistent to normal function body for IDE.
Doc comments in file beginning are now sticks to declarations
correctly.
Moving declarations at the end of scripts is fixed
2017-08-07 12:17:17 +03:00
Nikolay Krasko 8de6017e53 Minor: rename comments and whitespace binders file 2017-08-07 12:17:14 +03:00
Nikolay Krasko ae6f38e252 Minor: fix comment about AllCommentsBinder 2017-08-07 12:13:58 +03:00
Nikolay Krasko 6194bc10f8 Move statement out of top-level lambda in scripts (KT-19322)
#KT-19322 Fixed
2017-08-07 12:12:41 +03:00
Dmitry Petrov 656f8bb5cf Turn SwitchCodegenUtil into a class 2017-08-07 10:31:02 +03:00
Dmitry Petrov 435cfeea0a SwitchCodegenUtil: convert to Kotlin and cleanup 2017-08-07 10:31:02 +03:00
Dmitry Petrov c5772e5549 SwitchCodegenUtil: .java -> .kt 2017-08-07 10:31:02 +03:00
Dmitry Petrov 2ed5a5e368 'when' should use intrinsics for '=='
#KT-19029 Fixed Target versions 1.1.5
 #KT-18818 Fixed Target versions 1.1.5
2017-08-07 10:31:02 +03:00