Commit Graph

60449 Commits

Author SHA1 Message Date
Sergey Rostov a339e7af19 build.gradle.kts: tests and docs for LastModifiedFiles collection 2020-01-10 15:41:23 +03:00
Dmitry Petrov 4cf8203ce7 PSI2IR: Unify behavior for lambda return values with old back-end
See KT-35849.

1. When expected lambda return type is a type parameter, don't generate
introduce implicit casts (even if the corresponding type parameter has
an upper bound that would otherwise require such cast).

2. Do not generate implicit null check for lambda return value of
@EnhancedNullability type.
2020-01-10 15:23:33 +03:00
Mads Ager c47e04ac8d JVM_IR: handle suspend functions for signatures in callable references. 2020-01-10 11:24:27 +01:00
anastasiia.spaseeva 3253907317 [Spec tests] Hotfix for not-null-assertion-expression test 2020-01-10 13:12:01 +03:00
Pavel Kirpichenkov 2a4e235e34 [NI] Decrease only input types check diagnostic level to warning 2020-01-10 13:05:40 +03:00
Nicolay Mitropolsky 23c2a5c830 Uast: fake light method for uast is created only when containing class exists (KT-35310, EA-219604) 2020-01-10 12:46:37 +03:00
Victor Petukhov 5917591205 Workaround an inliner problem upon which the compiler code itself stumbled
^KT-35856 Fixed
2020-01-10 12:13:46 +03:00
simon.ogorodnik 5b8ab76613 [FIR] Move JvmMappedScope to fir:jvm module 2020-01-10 12:02:10 +03:00
Alex Chmyr 16c82030a3 KT-20120 fixing bug for Java 9 Deprecated
Unconditionally changing it to @Deprecated("") in kotlin
2020-01-10 11:45:17 +03:00
simon.ogorodnik ba4163ba02 [FIR] Improve synthetic functional interfaces support
Rename fictitiousFunctionSymbols -> syntheticFunctionalInterfaceSymbols
Support suspend function interfaces
Add supertypes for KFunction / KSuspendFunction
2020-01-10 10:57:36 +03:00
Juan Chen 573188bdc4 [FIR2IR]: fix translation of this references in instance methods
Currently FirThisReceiverExpression of instance methods are translated
to references of the class' thisReceiver,
not the method's dispatch receiver,
which causes problems with IrFrameMap::typeOf,
as the class' thisReceiver is not in the typeMap.

This commit translates non-qualified "this" references of
instance methods to references of the methods' dispatch receiver.
2020-01-10 10:43:07 +03:00
Mikhail Glukhikh 6b4e5bc2f0 [FIR] Cleanup code and fix type check in SAM resolution 2020-01-10 10:23:53 +03:00
Juan Chen c464322b3a [FIR2IR] Fix translation of library func parameters with default values
In the existing implementation, the information that a library function
parameter has a default value is lost during Fir2Ir translation,
and thus later on,
calls to such functions are not converted to the corresponding stubs.

Test cases such as kt5844, which calls kotlin.test.assertEquals,
fail with messages like "java.lang.IllegalArgumentException:
Null argument in ExpressionCodegen for parameter VALUE_PARAMETER
name:message index:2 type:kotlin.String?",
due to nonnull checks in ExpressionCodegen.visitFunctionAccess
(ExpressionCodegen.kt:421)

Functions defined in the code to be compiled don't have this problem,
only those from deserializing jars.

This commit sets default values in IrValueParameterImpl
for such parameters during Fir2Ir translation.
Now kt5844 passes the nonnull check in
ExpressionCodegen.visitFunctionAccess but still fails in a later stage
(java.lang.ClassNotFoundException: kotlin.internal.ir.Intrinsic).
2020-01-10 10:23:53 +03:00
Juan Chen 7eaac0bf2a [FIR]: allow char comparison in Fir2Ir 2020-01-10 10:23:53 +03:00
Juan Chen d407663734 Add another binding for wrapped parameter descriptors. 2020-01-10 10:23:53 +03:00
Juan Chen d3b21aed8a [FIR]: add missed bindings for WrappedReceiverParameterDescriptor. 2020-01-10 10:23:53 +03:00
Mikhail Glukhikh ea267d9ef4 [FIR IDE]: support enum entry search properly 2020-01-10 10:23:52 +03:00
Mikhail Glukhikh 2f6a48f70c Handle phase for FirEnumEntry correctly 2020-01-10 10:23:52 +03:00
Mikhail Glukhikh 05ee6fdd77 Add problematic enum test 2020-01-10 10:23:52 +03:00
Mikhail Glukhikh 7e946c6f5b Forbid manual phase updates during FIR compilation (non-IDE mode) 2020-01-10 10:23:52 +03:00
simon.ogorodnik 961037506a FIR2IR: support FirEnumEntry 2020-01-10 10:23:51 +03:00
Mikhail Glukhikh 3671c8489f FirEnumEntry: set correct child class name 2020-01-10 10:23:51 +03:00
Mikhail Glukhikh 97670e5036 [Raw FIR] Fix PSI consistency test (enum entry) + some cleanup 2020-01-10 10:23:51 +03:00
Mikhail Glukhikh 2b05320ae9 [Raw FIR] Synchronize enum entry building in PSI / light AST modes 2020-01-10 10:23:51 +03:00
simon.ogorodnik 65a44e2e20 Migrate to FirEnumEntry 2020-01-10 10:23:50 +03:00
simon.ogorodnik 5b5a5292b7 Support FirEnumEntry in FirRenderer 2020-01-10 10:23:50 +03:00
simon.ogorodnik c6e28537ff Create node for FirEnumEntry 2020-01-10 10:23:50 +03:00
Simon Ogorodnik 13132e69a3 [FIR] Start enum entries reworking 2020-01-10 10:23:50 +03:00
Ilya Matveev 68d64f1b5c IDEA plugin: Don't create iOS test in the share lib project template
Since 1.3.70 an iOS simulator test task is created by the MPP Gradle
plugin out of the box. So we stop creating such a task manually in
the shared library project template.

Issue #KT-35560 Fixed.
2020-01-10 11:52:34 +07:00
Ilya Gorbunov c084dfa1d7 [JS IR] stdlib: use 'base' plugin instead of kotlin("jvm")
'base' plugin is enough in this case, given that a couple of tasks is registered and configured manually.

Fix kotlin-reflect dependency to be a project dependency.
2020-01-09 22:57:50 +03:00
Ilya Gorbunov a9fec21178 [JS IR] stdlib: switch between artifacts rather than artifact content
The switch `includeStdlibJsIr` now affects which artifact is published:
the one with IR or the one without. Previously it affected
whether or not IR was bundled into the artifact "with IR".
2020-01-09 22:57:45 +03:00
Ilya Gorbunov 372a4009bd Fix coreLibsInstall composite task again
See the commit f0e67f8397 for details
2020-01-09 22:54:57 +03:00
Georgy Bronnikov 8d0ffa1444 IR: copy type parameters for local functions in LocalDeclarationLowering
Local functions raised in LocalDeclarationLowering continue to refer to
type parameters that are no longer visible to them.
This commit only adds new type parameters to their declarations, which
makes JVM accept those declarations. The generated IR is still
semantically incorrect (needs further fix), but code generation seems
to proceed nevertheless.
2020-01-09 22:10:27 +03:00
Georgy Bronnikov 01da7f289b JVM_IR: rework type parameters in AddContinuationLowering 2020-01-09 22:10:27 +03:00
Georgy Bronnikov d81231fdf7 JVM_IR: fix type arguments in inline callable references 2020-01-09 22:10:27 +03:00
Georgy Bronnikov a67df82b1e IR: modify IrTypeParametersContainer.copyTypeParameters() 2020-01-09 22:10:27 +03:00
Pavel Kirpichenkov 96c1b96f3a [NI] Report "not enough information" on callable references in lambdas
^KT-34314 Fixed
2020-01-09 20:43:15 +03:00
Mads Ager 4e4e57f60a JVM_IR: deal with inline class default values in AddContinuationLowering.
Whenever we want the default 0/null value for a type we need to
check if it is a non-nullable inline class type and produce
the right value for the underlying type.
2020-01-09 18:05:28 +01:00
Mark Punzalan 31ba2d64db [JVM IR] Mangle variable names for anonymous parameters in lambdas. 2020-01-09 17:57:50 +01:00
pyos 88cac53d88 JVM_IR: skip synthetic enum parameters in signatures 2020-01-09 15:58:59 +01:00
anastasiia.spaseeva 94c008872e [Spec tests] Fix tests 2020-01-09 17:16:13 +03:00
anastasiia.spaseeva 7dc469b32d [Spec tests] Minor changes of TestInfoParser and Generated files 2020-01-09 17:16:13 +03:00
anastasiia.spaseeva e0743f2268 [Spec tests] Add fixed tests for expressions section, fix linkage for reference-equality-expressions section 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva 9e3ecbd902 [Spec tests] Add codegen tests for indexing-expression (paragraph 3) 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva 0a1b8a928c [Spec tests] Add tests for not-null-assertion-expression 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva e4d12593be [Spec tests] Add tests for postfix-expressions, postfix-decrement-expression && postfix-increment 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva 7980db8613 [Spec tests] Add tests for prefix-expressions, logical-not--expression 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva e5a9a58d65 [Spec tests] Add tests for prefix-expressions, unary-minus-expression and unary-minus-expression 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva a8af3dc3c9 [Spec tests] Add tests for prefix-decrement-expression 2020-01-09 17:16:12 +03:00
anastasiia.spaseeva 01a4562076 [Spec tests] Add tests for additive-expression and Multiplicative expression 2020-01-09 17:16:12 +03:00