Commit Graph

26771 Commits

Author SHA1 Message Date
Mads Ager 98ceee784a JVM_IR: More special bridge rewriting.
If there is an existing method that will have its argument types
remapped to boxed types, make sure to reflect that in the IR so
that code will be generated for a boxed value instead of a
primitive value.
2019-11-25 17:37:57 +03:00
Dmitriy Novozhilov 5e5038416e Revert "tmp"
This reverts commit 3e336913
2019-11-25 16:20:06 +03:00
Dmitriy Novozhilov 3e336913b6 tmp 2019-11-25 14:44:46 +03:00
Dmitriy Novozhilov 4fc554fa9a [FIR-TEST] Add test with unresolved SAM usage of Comparator 2019-11-25 14:44:46 +03:00
Dmitriy Novozhilov 98af866417 [FIR] Fix stopping in AbstractFirUseSiteMemberScope 2019-11-25 14:44:46 +03:00
Dmitriy Novozhilov 52caa6a58d [FIR] Don't recreate type resolver in FirSpecificTypeResolverTransformer 2019-11-25 14:44:45 +03:00
Dmitriy Novozhilov 841ba6ea11 [FIR] Add generating of rawBuilder tests for light tree 2019-11-25 14:44:45 +03:00
Dmitriy Novozhilov 43e621530f [FIR] Add type parameters to FirQualifierExpression
It is needed for resolving qualifiers with type arguments
  like `Array<String>::class`
2019-11-25 14:44:44 +03:00
Pavel Kirpichenkov 4622041706 Update box test for unsigned to signed conversions
Updated test checks, that large unsigned numbers are converted to corresponding
negative signed numbers properly. Using unsinged constants instead of signed
in test allows to remove supressed OI error as well as use test with NI.
2019-11-25 12:22:58 +03:00
Yan Zhulanow 076166c22f Debugger: Generate line numbers for class initializers with a number on the 'init' keyword (KT-16277)
Debugger tests not absent as they use the bootstrap version of kotlinc.
Obviously, this change is not present in it yet.
2019-11-25 17:26:31 +09:00
Pavel Kirpichenkov 55b3637f03 Fix case of inner object usage in missing supertypes checker
FakeCallableDescriptorForObject instance, which is not ConstructorDescriptor,
is checked with call checkers when object's contents are being used.
Checker of missing supertypes should not be run against this fake descriptor.
Object's members belong to separate member scope, so their resolution doesn't
force containing class' supertypes evaluation. I.e. object's methods
may work fine even if some supertypes of containing class are missing.
2019-11-25 10:57:52 +03:00
Mark Punzalan 5afab1ac2b [FIR] FIR2IR: Populate calls with type arguments and function type
parameters with bounds/supertypes.
2019-11-25 09:37:47 +03:00
Nikolay Krasko 6797fb476c Support auto-mute from file for database with mutes 2019-11-22 22:12:37 +03:00
Vyacheslav Gerasimov 027bc671c1 Build: Remove duplicated compiler.xml from idea module
Workaround for JPS build by copying compiler.xml in test runner before tests

For gradle just copy it in the processResourcesTask of idea project

 #KT-34528
2019-11-22 18:52:00 +03:00
Pavel Kirpichenkov 8c103629a6 Disable FIR box test for callable references to vararg function 2019-11-22 18:22:04 +03:00
Denis Zharkov 9dc628bd72 Fix FirJavaElementFinder.kt.183 compilation 2019-11-22 13:01:56 +03:00
Alexey Tsvetkov d3f906a1a2 Minor: extract method & reformat to improve readability 2019-11-22 12:54:42 +03:00
Kevin Bierhoff ed6b90002e conservatively generate code if descriptor unavailable, which happens for some suspend inline functions
KT-33604
2019-11-22 12:54:42 +03:00
Kevin Bierhoff 0285b26e40 make FunctionCodegen skip method bodies we don't need, which avoids problems with inlining methods inside methods we don't need
KT-33604
2019-11-22 12:54:42 +03:00
Pavel Kirpichenkov 34b8b96cde Generate forgotten FIR box test 2019-11-22 11:10:47 +03:00
Jens Klingenberg 508330e0bb Remove deprecated method from CommandLineProcessor 2019-11-22 16:06:35 +09:00
Zalim Bashorov 3fa431e114 [JS IR] Don't use full paths when generating comments with a path for file blocks 2019-11-21 23:51:09 +03:00
Zalim Bashorov c05c07f243 [JS IR] Generate special region comments at the start and the end of each file block
It allows to fold these blocks and navigate to them in the IDEA.

Also, this commit adds compiler configuration keys to control generating comments with paths for file blocks,
and now generating such comments is enabled only in our tests.
2019-11-21 23:51:08 +03:00
Zalim Bashorov fa76b9cf83 [JS IR] Use single line comment instead of JsDoc comment for comments with path 2019-11-21 23:51:08 +03:00
Zalim Bashorov 5fe79f71ad [JS IR] Don't generate comment with path for "empty" files 2019-11-21 23:51:08 +03:00
Igor Yakovlev 8f9895e64e Add external keyword support for UL
Fixed #KT-34923
2019-11-21 22:49:23 +03:00
Pavel Kirpichenkov f80a71517f [NI] Handle vararg parameter in reflection type wrt array types
Vararg parameter in reflection type is interpreted as covariant
array type against array in expected functional type and as
vararg element type otherwise. For instance having function
fun foo(vararg args: Int): Unit { /*...*/ }
reference ::foo can be passed against expected
(Int) -> Unit,
(Int, Int) -> Unit, etc.
In none of such cases type for parameter in foo's reflection type
should be changed to array.
However, against expected type (IntArray) -> Unit args' type
must become IntArray.

^KT-25514 Fixed
2019-11-21 20:07:14 +03:00
Mikhail Glukhikh 7d944e2023 FIR dispatch receiver: check nullability only (expected vs actual type)
This gives a minor performance boost and prepares for upcoming K/J type mapping
2019-11-21 19:00:50 +03:00
pyos d221c1f242 JVM_IR: refactor MoveCompanionObjectFieldsLowering
* Extract replacement of IrGetField/IrSetField into a separate
   file-level lowering (should reduce the amount of work to linear in
   the number of classes rather than potentially quadratic)

 * Extract static backing field construction into JvmDeclarationFactory
   and move that lowering after PropertiesToFields lowering to reduce
   code duplication
2019-11-21 15:14:44 +01:00
Pavel Kirpichenkov afd59f0d46 [NI] Fix 'only input type' check for intersection types
Check worked incorrectly in case when argument type and expected type are the
same intersection type, which is possible for local variables without explicit
type declaration.
2019-11-21 15:59:26 +03:00
pyos 57760e5873 FIR: set anonymous initializers' parents 2019-11-21 15:53:52 +03:00
Alexander Udalov b38153e402 Minor, add runtime and comment to test on multi-file isInitialized 2019-11-21 13:46:53 +01:00
Alexander Udalov bf06d381b9 Minor, move old Java nullability assertion tests under oldLanguageVersions/
Also drop the (now confusing) "_lv12" suffix from newer tests
2019-11-21 13:46:17 +01:00
pyos 0f4f3f2429 FIR: set correspondingPropertySymbol of backing fields 2019-11-21 15:27:53 +03:00
Mikhail Glukhikh 0dcce9f584 FIR: add forgotten annotation calls resolve at some points 2019-11-21 14:25:27 +03:00
Mikhail Glukhikh 1bc4642fc9 Run CompileKotlinAgainstJava tests in both APT / non-APT modes 2019-11-21 14:25:16 +03:00
Mikhail Glukhikh 393047883e JavacWrapper: add Kotlin classes to classpath only in APT mode 2019-11-21 14:25:13 +03:00
Mikhail Glukhikh 89a582b694 JavacWrapper: perform makeOutputDirectoryClasses hack only in non-APT mode
For some reason, working without APT requires this call in JavacWrapper.
From the other hand, working without APT does not require
Kotlin class files to be in javac classpath.
2019-11-21 14:25:08 +03:00
Dmitry Petrov d3a5dcb601 KT-35004: keep track of KotlinType for 'when' subject 2019-11-21 10:48:14 +03:00
Mikhail Glukhikh 338b4e2eab Refactor AbstractCompileKotlinAgainstJavaTest 2019-11-21 10:10:58 +03:00
Mikhail Glukhikh 32aba31819 Cleanup: AbstractCompileKotlinAgainstJavaTest 2019-11-21 10:10:53 +03:00
Georgy Bronnikov 307c82e3a4 JVM_IR: redirect to correct function in special brigdes
The fix in MethodSignatureMapper allows us to avoid the hack
with orphanedCopy() in BridgeLowering.
2019-11-20 21:00:59 +03:00
Mikhail Zarechenskiy ef567c868e [NI] Add checkCanceled checks before resolving a candidate
This is an analogue that was done for old inference in CandidateResolver
2019-11-20 18:14:58 +03:00
Mikhail Zarechenskiy 63e62dcf42 Add checkCanceled check on resolving imports path
Imports resolution is a rather time consuming task and doesn't have
 `checkCanceled` on its computation path. So, if a thread is resolving
 imports it will do it until the end of computation, which can lead to
 unnecessary work and some IDE freezes.

 #KT-34990 Fixed
2019-11-20 18:14:57 +03:00
Denis Zharkov db24d4ac9a FIR: Drop ConeTypeAliasLookupTag 2019-11-20 18:02:08 +03:00
Denis Zharkov 38500d27e8 FIR: Add cache for expanded types 2019-11-20 18:02:07 +03:00
Denis Zharkov 159aefd26d FIR: Refactor Cone types
- Get rid of AbbreviatedType
2019-11-20 17:57:35 +03:00
Denis Zharkov e03162f2dd FIR: Rename ConeClassTypeImpl -> ConeClassLikeTypeImpl 2019-11-20 17:55:23 +03:00
Denis Zharkov f178cb6fb3 FIR: Replace trivial usages of ConeClassType with ConeClassLikeType 2019-11-20 17:55:23 +03:00
Alexander Udalov a485a5ffd6 JVM IR: load fields for JvmField properties from dependencies
This is needed to properly lower JvmField property calls to field
accesses.
2019-11-20 15:35:12 +01:00