Commit Graph

55798 Commits

Author SHA1 Message Date
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 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
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
Mikhail Zarechenskiy c77f18fbe6 [NI] Support callable references on qualified types with generics
#KT-32154 Fixed
2019-06-26 00:23:12 +03:00
nikita.movshin b8ccd98a17 Add changelog for 1.3.40 2019-06-25 19:33:10 +03:00
Pavel Punegov e9aec54f59 Ignore test in native because it doesn't support 40 parameters 2019-06-25 19:12:41 +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 60cbf0696d Do not generate tests with experimental coroutines on JVM_IR backend
Enable working tests.
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
Mikhail Zarechenskiy b3a05b1e0d [IDE-NI-MIGRATE] Update test-data after switching to NI 2019-06-25 15:55:47 +03:00
Alexander Gorshenev 76088cdf00 Bind WrappedVariableDescriptorWithAccessors in IR deserializer 2019-06-25 15:18:04 +03:00
Mikhail Zarechenskiy 48f25385ac [NI] Don't use old common supertype calculator in NI 2019-06-25 14:09:45 +03:00
Mikhail Zarechenskiy 60a0cf1fcc [NI] Fix exception: don't try to compute type depth on null type
#KT-32184 Fixed
2019-06-25 14:09:42 +03:00
Mikhail Zarechenskiy a26cf86af7 [NI] Fix exception: callable reference is used with an unresolved LHS
#KT-32187 Fixed
2019-06-25 14:09:38 +03:00
Mikhail Zarechenskiy bc0773b219 [NI] Capture receiver of invoke-based call
#KT-32133 Fixed
2019-06-25 14:09:34 +03:00
pyos 54d1df3147 JVM_IR: fix unbound function references 2019-06-25 12:29:23 +02:00
Nikolay Krasko 674badc692 Register mock injection language manager in compiler
In 192 it's important to have service registered since
https://github.com/JetBrains/intellij-community/commit/f204718c885034bc2fa4be4b281ff4bbd5fa4ef4

Caused by: java.lang.IllegalArgumentException: Argument for @NotNull parameter 'value' of com/intellij/openapi/util/UserDataHolderBase.putUserDataIfAbsent must not be null
	at com.intellij.openapi.util.UserDataHolderBase.$$$reportNull$$$0(UserDataHolderBase.java)
	at com.intellij.openapi.util.UserDataHolderBase.putUserDataIfAbsent(UserDataHolderBase.java)
	at com.intellij.openapi.util.NotNullLazyKey.getValue(NotNullLazyKey.java:41)
	at com.intellij.lang.injection.InjectedLanguageManager.getInstance(InjectedLanguageManager.java:41)
	at com.intellij.psi.impl.PsiCachedValue.isVeryPhysical(PsiCachedValue.java:74)
	at com.intellij.psi.impl.PsiCachedValue.anyChangeImpliesPsiCounterChange(PsiCachedValue.java:57)

Reproduced with Fir2IrTextTestGenerated
2019-06-25 11:49:00 +03:00
Nikolay Krasko ebcf306ecc Update proguard rules for 192 idea 2019-06-25 11:48:59 +03:00
Nikolay Krasko 5119979571 Fix compile warnings with 192.5118.30 in backward compatible way 2019-06-25 11:48:59 +03:00
Nikolay Krasko beb1bc09d4 Update to 192.5118.30 2019-06-25 11:48:59 +03:00
Nikolay Krasko 997d896557 Inline ORDER_ENTRY_TYPE_ATTR to fix compilation in 192 branch 2019-06-25 11:48:58 +03:00
Nikolay Krasko 96f0f444ad Remove dependency to IconLoader from compiler 2019-06-25 11:48:58 +03:00
Nikolay Krasko aa079376e7 Fix signing artifacts (KT-32192)
Broken in f1e3e26e6cd6e38b473ffe1a23b19b68ebb2d11f.

----
> Task :kotlin-reflect:signArchives FAILED
Build time for tasks:
Compiling kotlin: 1.44s (12.33% of total time)
Processing jars: 4.28s (36.75% of total time)
Uncategorized: 5.39s (46.26% of total time)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':kotlin-reflect:signArchives'.
> Duplicate key Signature kotlin-reflect:jar.asc:asc:
---

 #KT-32192 Fixed
2019-06-25 11:46:17 +03:00
Dmitry Gridin 2ef2c358c4 RedundantLetInspection: fix descriptions 2019-06-25 15:10:17 +07:00
Dmitry Gridin 7e0db3d612 ComplexRedundantLetInspection: fix highlight for multiple line receiver
#KT-31278 Fixed
2019-06-25 14:37:04 +07:00
Dmitry Gridin b97aaf0f71 Split ReplaceSingleLineLetInspection to SimpleRedundantLet & ComplexRedundantLet
Relates to #KT-32010
2019-06-25 14:37:04 +07:00
Dmitry Gridin 8e0bbe7d4a Convert ReplaceSingleLineLetIntention to inspection & decrease severity to INFORMATION
#KT-32010 Fixed
2019-06-25 14:37:04 +07:00
Dmitry Gridin ea76ea6fb8 Minor: cleanup ReplaceSingleLineLetIntention 2019-06-25 14:37:04 +07:00
Amaury bb0ee8ca0a Fix typo in jdksFinder.kt 2019-06-25 09:33:43 +02:00
Anton Yalyshev c8ad7b95cd small refactoring: hashSets are replaced by sets 2019-06-25 09:14:04 +03:00
Anton Yalyshev de02fcb626 it doesn't need to override second invoke(..) for FUS, as they both are called during refactoring 2019-06-25 09:14:04 +03:00