Mikhail Glukhikh
d96c66adac
FIR: partially implement invoke resolution
2019-07-08 16:59:37 +03:00
Igor Chevdar
e8ac22e238
Fixed some IR tests on enums
2019-06-27 19:04:01 +03:00
Dmitry Petrov
b3b7e26985
Make InsertImplicitCasts work with Descriptors and KotlinTypes again
...
This is a temporary change to make sure IrType infrastructure work is in
master.
It causes some of irText tests to work incorrectly (as in master).
2019-06-26 10:07:13 +03:00
Dmitry Petrov
8da5f6b955
IR: fixes after rebase
2019-06-26 09:39:17 +03:00
Dmitry Petrov
339291b01f
psi2ir: update testData
2019-06-26 09:39:16 +03:00
Dmitry Petrov
760806a1ac
IR: IMPLICIT_DYNAMIC_CAST
...
Generate IMPLICIT_DYNAMIC_CAST for implicit casts from `dynamic` to `T`
2019-06-26 09:39:16 +03:00
Dmitry Petrov
1d9cb39915
psi2ir: fix nullability assertion generation for platform types
...
Incorporate PR from Steven Schäfer into IrType-based implicit cast
insertion (commit 17b925636e8717e7648c5d7b792c6ab4d18f776d).
NB this still uses originalKotlinType to determine if the type was
nullability flexible. It is somewhat error-prone and something we want
to get rid of. However, it boils down to some design questions related
to implicit null checks in Kotlin - e.g., it might be Ok to just treat
nullability flexible type `T!` as `T?` in IR, generate null checks for
all usages of type `T?` where a non-null type is expected, and later
eliminate the null checks that are redundant according to the (quite
conservative) criterion in the redundant null check elimination.
2019-06-26 09:39:16 +03:00
Dmitry Petrov
ab38430ded
psi2ir: irText/.../types: NI vs OI
2019-06-26 09:39:15 +03:00
Dmitry Petrov
38ad56fb78
psi2ir: Update testData for intersection type tests
...
Actually, IrType-based InsertImplicitCasts provides proper casts here.
2019-06-26 09:39:15 +03:00
Mikhail Glukhikh
d41c50d6cf
FIR: support type inference for assignments, fix related lambda inference
2019-06-24 18:51:03 +03:00
Mikhail Glukhikh
c8003518a5
FIR: set super type reference properly
2019-06-20 15:26:40 +03:00
Mikhail Glukhikh
ca401cb01d
FIR2IR: support backing field symbols from FIR, fix test data
2019-06-20 15:26:40 +03:00
Mikhail Glukhikh
54078c4e9c
FIR resolve: support inferring property type from getter
2019-06-20 15:26:39 +03:00
Mikhail Glukhikh
b7da2f2ad8
FIR resolve: check early receivers on kotlin.* only
...
To provide more stable behaviour, the check introduced in the previous
commit is now applied only to extensions from kotlin.* package.
2019-06-19 22:48:52 +03: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
Mikhail Glukhikh
2db8409d85
FIR: introduce & resolve spread named arguments #KT-31575 Fixed
2019-05-28 10:20:42 +03:00
Mikhail Glukhikh
d0404b2c2a
FIR resolve: check number of parameters when handling Java accessors
2019-05-28 10:20:38 +03:00
Mikhail Glukhikh
d2bdbd8978
FIR resolve: record & check implicit extension receiver type properly
2019-05-28 10:20:35 +03:00
Mikhail Glukhikh
4d145db9f7
FIR resolve (by semoro): support correct type inference for generic args
...
This commit includes additional test and fixes e.g.
resolve of listOf() + listOf()
2019-05-28 10:19:12 +03:00
Simon Ogorodnik
d3f00280e9
Disable data class copy function body in raw FIR
...
After this commit we require 'copy' body generation in FIR2IR converter
2019-05-28 10:18:00 +03:00
Simon Ogorodnik
58873b2d7b
FIR resolve: set setter value-parameter type properly
2019-05-28 10:17:57 +03:00
Mikhail Glukhikh
05e4539019
Set resolved type for lambdas properly during FIR resolve
...
Partially done by semoro
2019-05-28 10:17:31 +03:00
Simon Ogorodnik
cef108a5ae
FIR: implement qualifier resolver
2019-05-28 10:17:05 +03:00
Mikhail Glukhikh
728459a504
Add IR for-in-range test
2019-05-23 14:02:12 +03:00
Mikhail Glukhikh
139557e641
FIR2IR: support super-types & type parameters for external class
2019-05-23 14:02:12 +03:00
Mikhail Glukhikh
a973a21ec6
FIR2IR: support assignments of local variables
2019-05-23 14:02:11 +03:00
Mikhail Glukhikh
2bf80ff64e
FIR: support copy functions in data classes
2019-05-23 14:02:10 +03:00
Simon Ogorodnik
672c172c99
[FIR] Make result type after safe-call nullable (for nullable receiver)
2019-05-23 14:02:10 +03:00
Simon Ogorodnik
f7b6fec70c
[FIR] Transform explicit receiver of QAE properly
2019-05-23 14:02:10 +03:00
Simon Ogorodnik
27a1ec3817
[FIR] Allow nullable receiver type in case of safe-calls
2019-05-23 14:02:10 +03:00
Mikhail Glukhikh
b28207deca
FIR2IR: support fields in Java FIR
2019-05-23 14:02:09 +03:00
Simon Ogorodnik
aa96837758
[FIR] Introduce unchecked not-null cast as internal operation for !!, ?:
2019-05-23 14:02:08 +03:00
Simon Ogorodnik
b469eb293b
[FIR] Typing for try-catch
2019-05-23 14:02:08 +03:00
Mikhail Glukhikh
26974788e9
FIR2IR converter: handle receivers and parents more correctly
2019-05-23 14:02:07 +03:00
Mikhail Glukhikh
f4fdc66a34
Introduce experimental FIR compiler #KT-31265 Fixed
...
This commit also includes several FIR2IR fixes which helps FIR compiler
to produce normal results
2019-05-23 14:02:06 +03:00
Steven Schäfer
90c3269502
Fix type parameters in WrappedClassConstructorDescriptor
...
IrConstructorCall gets type parameters from the class in addition to the
constructor declaration. This behavior is already implemented for
ClassConstructorDescriptorImpl, but was not implemented for
WrappedClassConstructorDescriptor, leading to missing type arguments for calls
to constructors generated in a lowering pass.
2019-05-16 20:26:18 +02:00
Steven Schäfer
f5a78213b2
Fix type of super
2019-05-16 07:58:45 +02:00
Mikhail Glukhikh
5262f0a53f
Fir2Ir: apply major text data update after a bunch of resolve changes
2019-04-30 18:45:57 +03:00
Simon Ogorodnik
c6aff9380b
FIR: support resolving to objects
2019-04-30 18:45:36 +03:00
Dmitry Petrov
865e0cc080
IR: IrConstructorCall: fixes after rebase
2019-04-26 17:43:26 +03:00
Dmitry Petrov
b78d1bb2b9
IrConstructorCall support in JVM_IR, JS_IR, and FIR2IR
2019-04-26 17:43:25 +03:00
Dmitry Petrov
11eea6e86a
psi2ir: generate IrConstructorCall elements in IR builder helpers
2019-04-26 17:43:24 +03:00
Dmitry Petrov
e3fd74a580
IR: annotations are represented as IrConstructorCall elements
...
Also, they are rendered somewhat nicer
2019-04-26 17:43:24 +03:00
Dmitry Petrov
37b1c175ce
IR: introduce IrConstructorCall / IrConstructorCallImpl
2019-04-26 17:43:24 +03:00
Mikhail Glukhikh
69ea0a3597
Fir broken FIR2IR test
2019-04-25 12:37:13 +03:00
Simon Ogorodnik
649c2f6bcc
FIR deserializer: load type-parameters correctly
2019-04-23 11:51:05 +03:00
Simon Ogorodnik
73b1676a03
Raw FIR: fix unary operators (now convention calls use receivers)
2019-04-23 11:40:32 +03:00
Mikhail Glukhikh
77e83dd8cf
Raw FIR: introduce string concatenation call
...
This removes some 'plus' calls to be resolved
2019-04-23 11:35:41 +03:00
Mikhail Glukhikh
618295f505
FIR: implement trivial typing for break & continue
2019-04-23 11:18:24 +03:00
Mikhail Glukhikh
cf72b13d84
Add accessor symbols & test for property overriding in Java
2019-04-23 11:15:24 +03:00