Commit Graph

51394 Commits

Author SHA1 Message Date
Alexey Tsvetkov ca79efdeec Remove unused methods from Gradle plugin 2019-01-16 15:57:32 +03:00
Alexey Tsvetkov e9abd69fc0 Drop support for Android Gradle plugin 2.x
#KT-27886 Fixed
2019-01-16 15:57:32 +03:00
Alexey Tsvetkov b51461b5c5 Drop support for Gradle 3.x
#KT-27885 Fixed
2019-01-16 15:57:32 +03:00
Svyatoslav Kuzmich c92a6f9ca2 [JS IR BE] Unmute inlineClasses tests 2019-01-16 12:11:28 +03:00
Svyatoslav Kuzmich befc371f6a [JS IR BE] Fix bridges construction function handle 2019-01-16 12:11:28 +03:00
Svyatoslav Kuzmich 912f0a267f [JS IR BE] Use return type in function signature for inline classes
Bridge function should be created when return type of override function
is specialised to unboxed inline class. Thus return type should be used in
function signature.

Non-inline-class return types are not added to signature for interop and
infrastructure reasons ("toString" would become "toString_ret$kotlin_String")
2019-01-16 12:11:27 +03:00
Svyatoslav Kuzmich ebdbe7ec30 [JS IR BE] Fix fake override functions resolve
Use signature of function 'target' (a real function that will
be called instad of fake override) to make boxing/unboxing decision for
return value and type parameters on call site.
2019-01-16 12:11:27 +03:00
Dmitry Petrov 08abf5f2a2 Specialize unsigned range and progression iterator calls 2019-01-16 11:00:23 +03:00
Dmitry Petrov 723e739960 Minor: convert ProgressionIteratorBasicValue to Kotlin 2019-01-16 11:00:23 +03:00
Felix Guo a71bb70901 KT-18715: don't swallow comments for if->elvis
Adds a CommentSaver to the IfThenToElvis intention that will save and
restore comments when converting an if expression to elvis expression.
2019-01-16 09:41:06 +03:00
Alexander Udalov 05c25342ad Make CommonToolArguments.nullable
#KT-28974 Fixed
2019-01-15 17:21:43 +01:00
Nicolay Mitropolsky 9559346199 191: Uast: implementation of UMethod.returnTypeReference (KT-29012) 2019-01-15 18:51:50 +03:00
Nicolay Mitropolsky 630b39d6b0 191: Uast: compiling with -Xjvm-default=compatibility 2019-01-15 18:51:49 +03:00
Nicolay Mitropolsky f4d585f836 Uast: removing unused KotlinUComponentQualifiedReferenceExpression 2019-01-15 17:22:07 +03:00
Nicolay Mitropolsky c139901889 Uast: all Kotlin versions of org.jetbrains.uast.test.* moved to org.jetbrains.uast.test.*.kotlin
To avoid having same class names in Kotlin and IDEA
2019-01-15 17:22:04 +03:00
Sergey Igushkin 3d208c31c8 Run Gradle integration tests against Gradle 5.1.1 2019-01-15 15:50:15 +03:00
Alexander Gorshenev 2775153c1a Got rid of an unecessary explicit cast. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev 606c622e61 Removed unnecessary nullability marks. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev 1e6240730b Added a TODO statement on special treatment of properties in deserializer. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev f10e826b52 Less eagerly fail on the boundary between deserializer and DeclarationStubGenerator. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev 884e6e15e9 Added a comment for separate treatment of properties in IrDeserializer interface. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev 32c2e841f2 Reversed DumpIrTree.kt fix for now, as it breaks tests comparing textual IR representation. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev 1ba4770800 A little fix to allow Wrapped and non-Wrapped descriptors to coexist. 2019-01-15 14:54:27 +03:00
Alexander Gorshenev cea32bd4e3 Minor changes in preparation for IR deserialization. 2019-01-15 14:54:27 +03:00
Mikhail Zarechenskiy 01ab4965b1 [NI] Support SAM conversions in backend for special expressions 2019-01-15 13:14:41 +03:00
Mikhail Zarechenskiy bcc720f1db [NI] Run arguments checker before outer call checker
This is needed because arguments checker updates unsubstituted and
 non-denotable types (type variables, IntegerValueType...)

 #KT-28718 Fixed
2019-01-15 13:14:41 +03:00
Nikolay Krasko 55498450d1 Minor: extract function without manager parameter 2019-01-15 12:49:48 +03:00
Nikolay Krasko 4e9c8cee70 Drop bunch code by introduction wrapper for PopupChooserBuilder 2019-01-15 12:49:48 +03:00
Denis Zharkov 3707812fc2 Revert "Temporary remove some tests after a fix for KT-24937"
This reverts commit ddb4e8b128.
2019-01-15 12:35:12 +03:00
Ilya Matveev ac1b4cf6b2 Allow setting test binary linker options using a test compilation
#KT-29254 Fixed
2019-01-15 12:07:55 +07:00
Vyacheslav Gerasimov 2157c777b3 Remove obsolete bunch fixes for 173 & as31 2019-01-14 21:29:03 +03:00
Vyacheslav Gerasimov b1f25874d8 Remove warnings from incompatible api inspection 2019-01-14 21:29:03 +03:00
Vyacheslav Gerasimov 13d87e8eae Remove as31 bunch files 2019-01-14 21:29:02 +03:00
Vyacheslav Gerasimov 818910267e Remove 173 bunch files 2019-01-14 21:29:02 +03:00
Vyacheslav Gerasimov 96c21297b6 Remove 173 and AS 3.1 from .bunch 2019-01-14 21:29:02 +03:00
Yan Zhulanow e4087b5a7a Fix testJavacIsLoadedOnce() kapt integration test 2019-01-14 17:41:09 +03:00
Max Medvedev 99ffcda5fc Type hints: don't show hint for qualified constructor calls or enum cases
#KT-29196 fixed
2019-01-14 17:23:45 +03:00
Denis Zharkov 2a156fe90c Do not check target when generating bridges with default impl
In many other places, e.g. org.jetbrains.kotlin.codegen.ClassBodyCodegen#generateDelegatesToDefaultImpl
we implicitly assume that whenever we use a default interface method
our target is 1.8

But here, we don't and it might lead to exception in org.jetbrains.kotlin.backend.common.bridges.BridgesKt#findConcreteSuperDeclaration
when actual target is 1.6 and we extend some AbstractMap implementation
with JDK8 (i.e., with @PlatformDependent getOrDefault)
2019-01-14 14:54:18 +03:00
Denis Zharkov 5ec93f2718 Avoid assertion in bridges-generation for light classes
^KT-11656
2019-01-14 14:54:18 +03:00
Denis Zharkov e0ff7281b4 Minor. Introduce FunctionHandle::mightBeIncorrectCode 2019-01-14 14:54:18 +03:00
Denis Zharkov cd51658976 Replace JvmTarget with GenerationState in DescriptorBasedFunctionHandleForJvm 2019-01-14 14:54:18 +03:00
Denis Zharkov 254380d418 Generate special bridges for removeAt/getOrDefault
In case we extending some Map specialization with non-trivial type arguments,
e.g. Map<String, String> from Kotlin point-of-view it has
"remove(String, String)" signature while in Java it's "remove(Object, Object)".

So, we generate an override "remove(String, String)" in first Kotlin class of the hierarchy,
which body delegates to "super.remove(Object, Object)"

Also, we generate a final override for "remove(Object, Object)" to allow
for Java inheritors choose only the version with String while overriding.

The main idea of the fix is to make mayBeUsedAsSuperImplementation
return true in case of PlatformDependent annotations.
Otherwise, we weren't able to choose the impl from the java.util.Map
as a delegate in our bridge.

Another part of the fix is overriding `isDeclaration`:
it was necessary because otherwise bridge-generation algorithm
was assuming that there's already an actual declaration
in the first sub-class (TestMap) in the test and we need to
delegate to the latter instead of the method from the interface

^KT-26069 Fixed
2019-01-14 14:54:18 +03:00
Denis Zharkov 949214c10b Refactor bridges generation for JVM
Make a separate subclass for DescriptorBasedFunctionHandle
to allow customize the behavior without complex abstract concepts
like `areDeclarationAndDefinitionSame`
2019-01-14 14:54:18 +03:00
Denis Zharkov 5cc242e878 Refactor FunctionHandle::isInterfaceDeclaration
- Give it more clear name mayBeUsedAsSuperImplementation
  because defining if it can be used as super-implementation
  this is what it used for
- The meaning is negated, so it's needed to negate its usages and impls
- Also, reuse it in findSuperImplementationForStubDelegation
2019-01-14 14:54:18 +03:00
Denis Zharkov 9736975d52 Minor. Reformat builtinSpecialBridges.kt 2019-01-14 14:54:18 +03:00
Dmitry Petrov 9973d59643 Use java.lang.Long.divideUnsigned/remainderUnsigned in Java 1.8+
#KT-24876
2019-01-14 14:17:52 +03:00
Dmitry Petrov a344feff5c Convert IntrinsicsMap to Kotlin 2019-01-14 14:17:52 +03:00
Dmitry Savvinov a4d1a8f60a Get rid of FUNCTOR slice, use lazy value in ContractDecription instead
Functor is an imperative representation of function's contract (contrary
to ContractDescription, which is a declarative one). ContractDescription
is convenient when we deal with sources of contracts declarations
(binaries, source), while Functors are convenient for analyzing code
with contracts.

It means that we have to convert ContractDescription into Functor when
we start working with contracts. This computation isn't trivial, and
Functor and ContractDescription are in 1-1 correspondence, so we would
like to cache Functor for each ContractDescription somewhere.

We used to do this in binding trace, in slice FUNCTOR.

Now, it turns out that this approach causes "Rewrite at slice"
exception, see KT-28847. We won't go into details of why that happens
here, you can see the issue comments for details (but be prepared for the
very long and nitty-gritty story)

This commit removes the problematic slice and introduces another
approach, where Functor is attached to the ContractDescription, computed
lazily and cached here.

^KT-28847 Fixed
2019-01-14 11:11:03 +03:00
Dmitry Savvinov 594a6588f9 Add test on rewrite at slice FUNCTOR 2019-01-14 11:10:37 +03:00
Dmitry Savvinov 0b1ff1a457 Minor: improve rendering of Traces in debugger
- add toString for ObservableBindingTrace (for debugging)
- add toString for LockProtectedTrace (for debugging)
- extract anonymous AbstractFilteringTrace to EffectFilteringTrace
2019-01-14 11:10:37 +03:00