Commit Graph

3790 Commits

Author SHA1 Message Date
Ilya Gorbunov 7573fcde53 Demote new experimental capitalize overloads in overload resolution
Revert "Fix method reference ambiguity in test after introducing 'capitalize' overload"
This reverts commit fe9bd9ee
2019-07-09 03:39:25 +03:00
Steven Schäfer da8fb3a195 JVM_IR: Respect -Xno-param-assertions 2019-07-08 17:48:33 +02:00
Steven Schäfer dd20b74030 Split GenerateNotNullAssertionsTests into standard box and bytecode tests 2019-07-08 17:48:33 +02:00
Yan Zhulanow 188ed82081 Debugger: Handle closure receivers came from outer callables properly (KT-31709) 2019-07-08 16:25:17 +09:00
Svyatoslav Kuzmich 918d470e1b [JS IR BE] Simplify throwable lowering.
- Make kotlin.Throwable class extenral
- Add runtime function 'extendThrowable' to use instead of delegating
  constructors to Throwable
2019-07-03 20:37:48 +03:00
Steven Schäfer e7a5e5b4a0 JVM_IR: Handle annotation KClass fields in external declarations 2019-07-01 16:16:23 +02:00
Steven Schäfer 078ccbf077 JVM_IR: Implement name mangling exceptions for Result class. 2019-07-01 15:49:12 +02:00
Steven Schäfer d458e4a7b2 JVM_IR: Enable inlining for external declarations with inline class parameters. 2019-07-01 15:49:12 +02:00
Mark Punzalan 1abdf0561a Generate synthetic functions for local functions with default values, by
re-ordering the lowering phases.

The changes in InterfaceLowering are necessary so that IrElements that
target the removed functions are re-targeted to the new functions in
DefaultImpls. This affects local functions in interface functions since
now LocalDeclarationsLowering comes before InterfaceLowering.
2019-07-01 13:24:08 +02:00
Mikhail Zarechenskiy c2cf4aa2b5 [NI] Move ability to convert standalone SAM-argument under the feature
If new inference is enabled only for IDE analysis, then this feature
 will be disabled to reduce difference between new and old inference,
 but if new inference is enabled in the compiler, then this feature
 will be enabled too to preserve behavior of new inference for
 compilation

 #KT-32175 Fixed
 #KT-32143 Fixed
 #KT-32123 Fixed
 #KT-32230 Fixed
2019-07-01 12:53:33 +03:00
Georgy Bronnikov f332aff4ce Mute back tests that still fail 2019-06-28 19:44:04 +03:00
Georgy Bronnikov 3a9b94235f JVM_IR: generate facade classes for imported toplevel declarations 2019-06-28 17:34:49 +03:00
Anton Bannykh fadeac083f JS: fix reified T::class for primitive T (e.g. Int) (KT-32215 fixed) 2019-06-28 13:49:22 +03:00
Mikhael Bogdanov 9b6fef005f Simplify LocalDeclarationsLowering, support declaration pop up via separate lower
1. Scheme of capturing local variables not touched
 2. Lowered local functions are transposed to the nearest class (including local) or file
 3. Local classes are also transpose to the nearest class (including local) or file
2019-06-27 08:07:01 +02:00
Ilmir Usmanov 7a096b305f Do not mangle functions with inline classes when the only inline class
in arguments is kotlin.Result.
Fix returnTarget for suspend function views.
2019-06-26 22:28:08 +03:00
Pavel Punegov e9aec54f59 Ignore test in native because it doesn't support 40 parameters 2019-06-25 19:12:41 +03:00
Ilmir Usmanov c613e04962 Do not try to create view of suspend function descriptor on IR BE
Keep container source in wrapped descriptor
2019-06-25 16:30:02 +03:00
Ilmir Usmanov 60cbf0696d Do not generate tests with experimental coroutines on JVM_IR backend
Enable working tests.
2019-06-25 16:30:01 +03:00
Ilmir Usmanov 379390c472 Introduce add continuation pass, which transforms each suspend function
and call to have additional continuation parameter.
2019-06-25 16:30:00 +03:00
pyos 54d1df3147 JVM_IR: fix unbound function references 2019-06-25 12:29:23 +02:00
pyos 6a21285aed JVM_IR: do not generate two nullary constructors
when the primary constructor with @JvmOverloads has default values for
all arguments.
2019-06-24 14:58:45 +02:00
Svyatoslav Kuzmich 0b19a4a32b [JS IR BE] Initial version of member namer 2019-06-21 17:02:01 +03:00
Dmitry Petrov 79d4b46d2b KT-32044 Fix unsigned integer coercion in loop intrinsics 2019-06-21 16:30:23 +03:00
pyos 8cca74c932 JVM_IR: support vararg & defaults in function references 2019-06-20 22:37:56 +03:00
Roman Artemev 88e92be091 [IR] Fix name clash between properties with the same fqn
Promote ABI version
2019-06-20 12:08:55 +03:00
Roman Artemev 50ad21e388 [IR BE] Fix symbol remapping for IrField/IrProperty
- Use appropriate wrapped descriptor
 - Add test
2019-06-19 10:24:15 +03:00
Roman Artemev 008cf03b06 [IR] Consider TypeParameter as public declaration and serialize it properly
- Add test case when TypeParameter of generic property is exposed outside its module
2019-06-14 18:40:59 +03:00
Roman Artemev efaf5a9947 [IR] Fix serialization of ENUM_SPECIAL members 2019-06-14 18:40:59 +03:00
Alexander Gorshenev a816de4865 Added a test for members of EnumEntry in a library. 2019-06-14 17:12:39 +03:00
Steven Schäfer 27a850be92 Fix genValueAndPut in IrInlineCodegen 2019-06-13 12:25:06 +02:00
Steven Schäfer 917ef250cf Add and (un)mute inline class tests 2019-06-13 12:25:06 +02:00
Ting-Yuan Huang f07be024b7 JVM_IR: handle JvmDefault for bridges. 2019-06-12 07:43:45 +02:00
Alexander Udalov c67517cb2b JVM IR: use fast class reading mode in boxAgainstJava tests
annotationsViaActualTypeAliasFromBinary.kt is ignored because
ExpectActualRemover can't find actual for the expected constructor of
Anno now, because `ExpectedActualResolver.findActualForExpected`
incorrectly filters out actual declarations without any source file, and
Java classes loaded in the fast mode don't have any source files.

This will need to be fixed separately, probably by making
ExpectedActualResolver look for the actual class of an expected class
member first (with source file-based filtering), and then
unconditionally locating the corresponding member there
2019-06-11 15:26:07 +02:00
Vasily Levchenko e3d2419beb [tests][codegen][coroutines] disable test simpleSuspendCallableReference for NATIVE too. 2019-06-11 12:07:58 +03:00
Mikhail Zarechenskiy 991e60c9e4 Add tests for obsolete issues
#KT-31784 Obsolete
 #KT-31757 Obsolete
2019-06-10 17:37:52 +03:00
Alexander Udalov bbbd47ead3 Minor, rename codegen test 2019-06-07 15:01:44 +02:00
Ting-Yuan Huang a447c748bc JVM_IR: support @JvmDefaults in compatibility mode. 2019-06-06 14:10:28 +02:00
Alexander Udalov 43cb17cdd5 Check expected type of annotation parameter correctly in AnnotationDeserializer
The main idea of this refactoring is to separate two usages of
`AnnotationDeserializer.resolveValue`: the one where we load annotation
argument values, and the one where we load constant values of properties
for JS/Native/Common
(`AnnotationAndConstantLoaderImpl.loadPropertyConstant`).

In the latter case, `expectedType` is the type of the property and it
can be a supertype of the actual value (e.g. see `arrayConst` in
compiler/testData/serialization/builtinsSerializer/compileTimeConstants.kt).
But in the former case, we need to check that the value conforms to the
expected type and disregard it if it's not the case, which is possible
if the annotation was recompiled separately.

 #KT-28927
2019-06-05 14:44:15 +02:00
Alexander Udalov c666b60ca3 Support arrays of class literals in AnnotationDeserializer
#KT-28927 Fixed
2019-06-05 14:44:14 +02:00
Ting-Yuan Huang 1b4d26e490 psi2ir: keep the type of when when possible
Ideally, the type of `IrWhen` should be provided by type inference for
a consistent behavior. `USED_AS_EXPRESSION` from CFG isn't always
consistent with type inference, unfortunately.

The behavior is now aligned with `if`. The type of `when` is kept when
it *can* be an expression, instead of whether it is used or not.
2019-06-05 10:23:44 +02:00
Mads Ager 0c586ef5c1 JVM_IR: Maintain annotations in SAM conversion.
Copy method and parameter annotations to the generated SAM
implementation method.
2019-06-05 08:21:59 +02:00
Mikhael Bogdanov 81e6416bfe Support bound callable reference inlining in IR 2019-06-04 14:56:13 +02:00
Mikhael Bogdanov 3c093f321d Support unbound callable function references in inliner 2019-06-04 14:56:12 +02:00
Roman 0163019295 [JVM IR] Unmute fixed test 2019-05-31 18:49:54 +03:00
Mikhail Zarechenskiy 268dddcb3d Remove restriction about JS_IR backend for test 2019-05-31 17:23:58 +03:00
Alexander Udalov 4c9e9b1f3a Fix KotlinReflectionInternalError on encountering 'clone' in a class
`RuntimeTypeMapper.mapSignature` threw exception because the descriptor
for `clone` was created manually in CloneableClassScope and therefore it
didn't have a JVM signature as in deserialized descriptors, and wasn't
recognized as a Java method either.

 #KT-22923 Fixed
2019-05-31 12:29:20 +02:00
Roman Artemev beb1ce55f8 [IR BE] Fix capturing of var-locals inside class/field initializers 2019-05-31 13:14:43 +03:00
Roman Artemev 5686de7e09 [JS IR BE] Make kotlinx.io compile
- Fix expect/actual default arguments
 - Fix dynamic type in inliner
 - Fix external varargs
2019-05-31 13:14:43 +03:00
Mikhael Bogdanov 79d855f7a4 Minor. Revert deleted by mistake test directive 2019-05-31 07:09:28 +02:00
Ting-Yuan Huang 74e8c7c1c5 JVM_IR: generate default constructor
Quoted from https://kotlinlang.org/docs/reference/classes.html

"On the JVM, if all of the parameters of the primary constructor have
 default values, the compiler will generate an additional parameterless
 constructor which will use the default values. This makes it easier to
 use Kotlin with libraries such as Jackson or JPA that create class
 instances through parameterless constructors."
2019-05-30 18:53:27 +02:00