Igor Chevdar
dff0ac8866
[Serializer] UniqId clashes handling
2019-06-27 19:04:00 +03:00
Igor Chevdar
b62e9487d1
Fixes in IrValidator
2019-06-27 19:04:00 +03:00
Igor Chevdar
595a549188
[IR] Fixes related to IR validation
2019-06-27 19:04:00 +03:00
Igor Chevdar
175dfb41b6
[IrSerializer] Supported all annotations + refactoring
2019-06-27 19:04:00 +03:00
Alexander Udalov
3800d57691
Fix behavior of multiple methods in IrTypeSystemContext
...
Make sure implementations are the same as in ClassicTypeSystemContext
and ConeTypeSystemContext
2019-06-27 16:43:07 +02:00
Alexander Udalov
445c4ebe65
Do not inherit IrTypeSystemContext from TypeSystemInferenceExtensionContext
...
This inheritance was not used. Moreover, multiple methods were
implemented incorrectly and/or inconsistently with the base
implementation at ClassicTypeSystemContext
2019-06-27 16:43:07 +02:00
Alexander Udalov
cf6ff8c6b3
Simplify implementation of TypeSystemCommonSuperTypesContext.typeDepth
2019-06-27 16:43:07 +02:00
Alexander Udalov
331f0291ce
Minor, remove TypeSystemContext.isNotNullNothing
...
Use equivalent isNothing instead
2019-06-27 16:43:07 +02:00
Alexander Udalov
9131ff3626
Move IrType.isNullable to 'ir.tree'
2019-06-27 16:43:06 +02:00
Alexander Udalov
29a144cee7
Minor, move IrClass.primaryConstructor to 'ir.tree'
2019-06-27 16:43:06 +02:00
Alexander Gorshenev
aa73420312
Provide the default hashing function
2019-06-27 13:56:25 +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
Mikhael Bogdanov
bb48e756ca
Minor. Simplify and clean IrElementVisitorVoidWithContext/IrElementTransformerVoidWithContext
2019-06-27 08:06:59 +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
Dmitry Petrov
991c87b9c2
Minor: remove empty JvmCoercionToUnitPatcher.kt
2019-06-26 16:16:04 +03:00
Anton Bannykh
d6c10d24e1
JS IR: move inliner to common part; inline suspendCoroutineUninterceptedOrReturnJS
2019-06-26 13:13:39 +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
7a44b0f951
IR: IrTypeOperatorCall.classifierSymbol can be computed from typeOperand
2019-06-26 09:39:16 +03:00
Dmitry Petrov
18c3778250
Minor: cleanup IrLazyProperty
2019-06-26 09:39:16 +03:00
Dmitry Petrov
1b5d077452
Minor: explicitly throw exception if declaration parent is not set
2019-06-26 09:39:16 +03:00
Dmitry Petrov
8e7ae3a996
Minor: IrTypeCheckerContext.removeExactAnnotation
2019-06-26 09:39:16 +03:00
Roman Artemev
6a82ffdc5e
[JS IR BE] Make tests work
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
422c13bd03
IR: add docs for IrTypeOperator's
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
3fa671943c
psi2ir: coerce SAM conversion arguments to corresponding function types
...
Given an expression with SAM conversion, e.g.:
```
fun test(a: Any?) {
if (a is () -> Unit) {
Runnable(a).run()
}
}
```
Here `Runnable(a)` expects `a` to be a value of functional type
`() -> Unit` (and corresponding type check makes smart cast possible).
Relation between `Runnable` and `() -> Unit` is somewhat non-trivial,
is implemented in terms of KotlinTypes and DeclarationDescriptors,
and so should be encapsulated in psi2ir if possible.
Thus, psi2ir generates IR such as
```
TYPE_OP type=java.lang.Runnable origin=SAM_CONVERSION ...
TYPE_OP type=kotlin.Function0<kotlin.Unit> origin=IMPLICIT_CAST ...
[| a |]
```
and InsertImplicitCasts knows that IMPLICIT_CAST actually might be
unnecessary (which also allows to use InsertImplicitCasts in some other
context that might require IMPLICIT_CAST rewriting, such as inlining).
2019-06-26 09:39:15 +03:00
Roman Artemev
332b191546
Fix ir type substitutor
2019-06-26 09:39:15 +03:00
Roman Artemev
7ac3f56a43
Fix InsertImplicitCasts to test isSubtypeOf
2019-06-26 09:39:15 +03:00
Roman Artemev
0c74eef500
Implement IrType context
2019-06-26 09:39:15 +03:00
Roman Artemev
3fc1419d01
[IR] Implement TypeChecker context and full isSubtypeOf/commonSuperType for IrType
2019-06-26 09:39:15 +03:00
Roman Artemev
b7d098af56
[IR] Implement captureFromArguments for IrType
2019-06-26 09:39:15 +03:00
Roman Artemev
d4e561baf6
[IR] Support IrType in type checker
2019-06-26 09:39:15 +03:00
Ilmir Usmanov
0ada383281
Move addFunctionOverride to AddContinuationLowering
2019-06-25 16:30:02 +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
53878b6961
Do not generate synthetic accessors of local functions as suspend
2019-06-25 16:30:02 +03:00
Ilmir Usmanov
48e64e8a07
Use WrappedSimpleFunctionDescriptor instead of real one for
...
suspend function views
2019-06-25 16:30:02 +03:00
Ilmir Usmanov
ca421e0aa5
Do not generate empty bodies for suspend functions
2019-06-25 16:30:01 +03:00
Ilmir Usmanov
95a65ba94d
Restore order of lowerings
2019-06-25 16:30:01 +03:00
Ilmir Usmanov
0628783308
Move coroutines-related stuff to AddContinuationLowering
2019-06-25 16:30:00 +03:00
Ilmir Usmanov
8306c28117
Generate continuation class for suspend lambdas
...
generate state-machine for coroutines.
2019-06-25 16:30:00 +03:00
Ilmir Usmanov
f369324520
Generate continuation class for named functions
...
TODO: Generate label and result for suspend lambdas
2019-06-25 16:30:00 +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
Alexander Gorshenev
76088cdf00
Bind WrappedVariableDescriptorWithAccessors in IR deserializer
2019-06-25 15:18:04 +03:00
pyos
54d1df3147
JVM_IR: fix unbound function references
2019-06-25 12:29:23 +02:00
Roman Artemev
544443f113
[JS IR BE] Initialize module dependencies in the correct order
2019-06-24 20:14:19 +03: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
Svyatoslav Kuzmich
3e10de9cd1
[JS IR BE] Fixup property accessors
2019-06-21 17:02:01 +03:00
Svyatoslav Kuzmich
84d48b8c7b
[IR BE] Don't override private declarations
2019-06-21 17:02:01 +03:00