Alexander Udalov
2585ce0aa7
Introduce TypeSystemCommonBackendContext, use in KotlinTypeMapper.getVarianceForWildcard
2019-07-17 13:55:35 +02:00
Alexander Udalov
0460b2990f
Use TypeSystemContext in KotlinTypeMapper.hasNothingInNonContravariantPosition
...
Thanks to this abstraction, this code will now easily work with
IrType-based TypeSystemContext implementation in the new IR type mapper
2019-07-17 13:55:35 +02:00
Alexander Udalov
bd8c09bfb5
JVM IR: move CollectionToArray creation to JvmSymbols
...
Also simplify it to use IR builder DSL
2019-07-17 13:55:35 +02:00
Alexander Udalov
15e0fd93bd
Minor, rename IrBuiltIns.IrTypeMapper -> BuiltInIrTypePair
...
To avoid name clash with the new IrTypeMapper in JVM backend
2019-07-17 13:55:35 +02:00
Alexander Udalov
f9a1e582b2
Minor, somewhat simplify ClassCodegen construction
2019-07-17 13:55:35 +02:00
Alexander Udalov
edaff968ad
Minor optimization in MutableList.transformFlat
2019-07-17 13:55:35 +02:00
Dmitry Petrov
28215186ca
IR serialization: migrate to new generated Java classes structure
2019-07-17 12:00:34 +03:00
Dmitry Petrov
8baa7dfe22
Generated Java classes for Kotlin IR protobuf
2019-07-17 12:00:34 +03:00
Dmitry Petrov
2305bea2b5
Generate IR protobuf classes as multiple Java files
...
Otherwise KotlinIr.java becomes too big for IDEA to swallow in the
default configuration.
2019-07-17 12:00:34 +03:00
Mikhail Glukhikh
7ccf21c5c8
FIR resolve: fix vararg parameter types
2019-07-17 10:45:07 +03:00
Mikhail Glukhikh
592cf4f4e8
Make FirNamedReferenceWithCandidate not resolved, fix receiver completion
...
Counting it as resolved provokes a lot of difficult to discover errors
2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
08f44d4f14
FIR resolve: add early protection against cyclic property resolve
2019-07-17 10:45:06 +03:00
Simon Ogorodnik
1222449dc8
FIR resolve: perform inference completion for property access
2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
99680a2ad7
FIR: refactor & simplify invoke resolve a bit
2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
fff954ed3f
FIR: skip extra non-valid groups during candidate resolve
2019-07-17 10:45:06 +03:00
Mikhail Glukhikh
b813f22cfe
Extract part of utility FIR transformers into TransformUtils
2019-07-17 10:45:05 +03:00
Mikhail Glukhikh
0ac23eef93
Minor (FIR resolve): replace session with fileSession
2019-07-17 10:45:05 +03:00
Simon Ogorodnik
3da11cc85b
Use no-op substitutor instead of substitutor with empty map
2019-07-17 10:45:05 +03:00
Mikhail Glukhikh
2d74dac4f2
FIR: set constructor parameter scope correctly for designated transformer
2019-07-17 10:45:05 +03:00
Mikhail Glukhikh
b8c3947827
Measure unresolved function call & qualified access # in FIR bench
2019-07-17 10:45:05 +03:00
Roman Artemev
af45e1c5dc
[JS BE] Do not produce source mapping for fake KtElement
...
Fix [KT-26701], [KT-12935]
2019-07-17 10:21:34 +03:00
Alexander Udalov
f38e4d618e
Support Array::class literal, forbid Array<X>::class on non-JVM
...
#KT-31230 Fixed
2019-07-16 15:57:26 +02:00
Mikhael Bogdanov
496765f41e
Support target templates in bytecode tests
...
Avoid test data duplication
2019-07-16 14:08:27 +02:00
Mark Punzalan
de1e27c584
Make all progression headers inclusive, and decrement last for
...
last-exclusive progressions (i.e., "until" progressions and loop over
array indices).
This change makes it possible to correctly implement the handling of
"step" progressions. Computing the last element of a stepped progression
requires that the last is inclusive.
Also invert the while loop (into if + do-while) that is used when
lowering for-loops over progressions that cannot overflow. This keeps
the performance characteristics closer to the ForLoopsLowering in
kotlin-native, since the goal is to converge to this shared version.
Also used IrType instead of KotlinType, where possible.
https://github.com/JetBrains/kotlin/pull/2390
https://github.com/JetBrains/kotlin/pull/2305
2019-07-16 14:08:21 +02:00
Ilya Chernikov
cfab89385f
Do not override path calculation in light virtual files in tests:
...
seems unnecessary anymore and breaks some script testing logic
2019-07-16 12:20:21 +02:00
Jake Wharton
4386518c4d
Add intrinsic for ULong/UInt.toString on Java 8+
...
Unfortunately this cannot currently be done for the extension overload which accepts a radix due to behavior difference with regard to invalid radix values.
2019-07-16 11:15:19 +02:00
Alexander Udalov
385366384c
Psi2ir: ignore unresolved annotations
...
Note that the test is an exact copy of an existing test
missingDependencyNestedAnnotation, but with -Xuse-ir
2019-07-15 18:40:00 +02:00
Dmitry Petrov
6963424dfc
psi2ir: Empty 'if' branches have type 'kotlin.Unit'
2019-07-15 08:58:04 +03:00
Mikhael Bogdanov
0774f800a0
Split android box tests by flavours
2019-07-15 07:31:35 +02:00
Igor Yakovlev
cd6abcd4c9
Expect modifier definitions is not exposed by UL-classes
2019-07-12 16:33:52 +03:00
Igor Yakovlev
0602a6da72
Fix invalid FakeJvmFieldConstant inspection for UL classes
...
Test MultiFileInspectionTestGenerated.testFakeJvmFieldConstant_FakeJvmFieldConstant now correctly works with ultra-light annotation classes.
2019-07-12 16:33:52 +03:00
Igor Yakovlev
a9aa60491e
Fix UL-classes test renders and test data
2019-07-12 16:33:51 +03:00
Igor Yakovlev
4b1226e3d7
Set correct nullability and Companion support to annotations
2019-07-12 16:33:51 +03:00
Igor Yakovlev
eea469939e
Kotlin meta-annotation converter for UL-annotations
2019-07-12 16:33:51 +03:00
Igor Yakovlev
afe784e79e
Add UL-annotations support
2019-07-12 16:33:51 +03:00
Ilya Chernikov
0cc40440fb
Implement filePathPattern in the script configuration with handling
...
also
- tests
- extending kdoc for the definitions
2019-07-12 13:44:09 +03:00
Roman Artemev
efafb6585e
[JS IR BE] Refactored js("...") function
...
- support object expression
- do not wrap in function in statement-level position
- support implicit return
- code clean up
2019-07-11 18:00:28 +03:00
Roman Artemev
946bc75cda
[JS IR BE] Code clean up
...
- Remove hacks for unbound symbols in TypeOperatorLowering
- Replace hacker intrinsics with dynamic operations
- Fix return type for `Object$create` intrinsic
2019-07-11 18:00:28 +03:00
Roman Artemev
f9336555da
[IR] Remove code duplication in IrTypeCheckerContext
2019-07-11 18:00:28 +03:00
Ilya Chernikov
382e55284c
Fix legacy definitions error propagation
...
also fixes script-util test with resolving errors
2019-07-11 15:50:26 +02:00
Ilya Chernikov
9c004c3a52
Refactor scripting compiler plugin - move cli dependent parts out of the -impl jar
...
The kotlin-scripting-compiler-impl jar is used in the idea plugin and
therefore should not depend on the cli parts of the compiler to avoid
dependency from the plugin to the kotlin-compiler.jar.
Therefore the cli-dependent parts were moved to the scripting plugin
jar, which is used only in cli compiler based environments.
Also implement required abstractions to allow this movement and
drop some redundant dependencies to the cli parts in other projects.
2019-07-11 15:50:26 +02:00
Ilya Chernikov
9ae0ff03fa
Improve script and REPL result handling:
...
- implement error result
- refactor other result classes
- implement handling in the script evaluation extension - also restores
previous script error reporting functionality
- add possibility to customize result fileds in script and REPL
- refactor result calculation in the backend: cleanup, rename (since
it is not only about REPL now)
2019-07-11 15:50:26 +02:00
Ilya Chernikov
1ab255eafb
Use kotlin home for automatic loading of the scripting plugin
2019-07-11 15:50:25 +02:00
Dmitry Petrov
6ea33986fa
psi2ir: Provide substituted descriptor for property references
2019-07-11 15:32:43 +03:00
Igor Yakovlev
1968fd7fcb
Remove check for files count for mirror elements set in light classes
...
It is workaround about intensive exception #EA-121413. There is no idea how to fix it fast but it is a try. In case of using UltraLight classes we hope not to
use old fashion light classes anymore soon. (Fixed #KT-28193)
2019-07-11 14:21:32 +03:00
Mikhail Glukhikh
43c6049f02
FIR2IR: set origin correctly for synthetic property accesses
2019-07-11 12:46:48 +03:00
Mikhail Glukhikh
c6a09dba4e
FIR: consider Java default constructors as primary ones
2019-07-11 12:40:29 +03:00
Mikhail Glukhikh
2ceffa241b
FIR: make Java default constructor visibility same with class visibility
2019-07-11 12:38:53 +03:00
Mikhail Glukhikh
c35d7eab70
Refactor FIR symbols to make them and their FIR element types more clear
...
This commit also fixes work with Java synthetic properties
2019-07-11 12:37:32 +03:00
Mikhail Glukhikh
eb00af6b96
CFG: mark annotation arguments as "used as expressions" #KT-24596 Fixed
...
NB: only classes / function / properties annotations are considered here,
not including local declarations and other annotations
2019-07-10 15:10:52 +03:00