Commit Graph

127 Commits

Author SHA1 Message Date
Nikolay Lunyak 56b2a984ce [FIR] Quick fix FirModifierChecker 2021-09-11 22:05:35 +03:00
Aleksei.Cherepanov cc5382b37e [JPS] Fix incremental build after changing Java constant
InlineConstantTracker implemented for tracking changed java static final constants, that used in kotlin.

#KT-46506 Fixed
2021-09-11 13:00:00 +03:00
Ivan Kochurkin 8cdb79f969 Move JvmNames, JvmFieldApplicabilityProblem to common.jvm module 2021-09-10 00:49:10 +03:00
Ivan Kochurkin 69a13a3269 [FIR] Use getAnnotationByClassId instead of getAnnotationByFqName in JVM checkers 2021-09-10 00:49:09 +03:00
Ivan Kochurkin 2baed77598 [FIR] Add JVM_SYNTHETIC_ON_DELEGATE diagnostic
Extract JVM names to common JvmNames
2021-09-10 00:49:03 +03:00
Ivan Kochurkin e3805c9b98 Extract JvmNames, JvmFieldApplicabilityProblem to compiler.common 2021-09-10 00:49:01 +03:00
Nikolay Lunyak 7006426304 [FIR] Add support for JVM_STATIC_ON_CONST_OR_JVM_FIELD diagnostic 2021-09-09 20:18:49 +03:00
Nikolay Lunyak c2e5583780 [FIR] Add support for JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION diagnostic 2021-09-09 20:18:49 +03:00
Nikolay Lunyak 5607be3920 [FIR] Add support for INAPPLICABLE_JVM_NAME diagnostic 2021-09-09 20:00:36 +03:00
Dmitriy Novozhilov 15b77045ee [FIR] Remove all usages of classes and methods from FE 1.0 from FIR checkers 2021-09-09 17:20:21 +03:00
Jinseong Jeon 9e7ee2fdea Unify and use default value parameter name in default setter 2021-09-09 16:07:09 +02:00
Jinseong Jeon cd4a08cb18 Migrate ReadWriteAccess and checker logic (from frontend-independent) 2021-09-09 16:07:09 +02:00
Dmitriy Novozhilov 69c3831865 Rename Deprecation to DeprecationInfo 2021-09-02 15:04:07 +03:00
Dmitriy Novozhilov 762d225bd7 Unify Deprecation classes from :core:compiler.common and :compiler:frontend modules 2021-09-02 15:04:06 +03:00
Dmitriy Novozhilov 7e6e0a3dd6 Remove all type system-specific inheritors of TypeCheckerState 2021-08-26 10:08:51 +03:00
Dmitriy Novozhilov 3f6738c8bc Remove all type system dependent methods from TypeCheckerState 2021-08-26 10:08:51 +03:00
Dmitriy Novozhilov e07512a847 Delegate refineType and prepareType in TypeCheckerState to special services
This is needed to add ability to create type system independent TypeCheckerState
2021-08-26 10:08:51 +03:00
Dmitriy Novozhilov 8b5548df49 Rename AbstractTypeCheckerContext to TypeCheckerState 2021-08-26 10:08:51 +03:00
Tianyu Geng c940972674 FIR IDE: add shortcut to check if a KtSymbol is deprecated 2021-08-24 20:12:51 +03:00
Ilmir Usmanov 486c6b3c15 Remove obsolete experimental coroutines support
in compiler.
2021-08-13 22:31:30 +02:00
Ivan Kochurkin f2ffead881 Reduce allocations in KotlinTarget and modifier checkers 2021-08-13 18:32:29 +03:00
Tianyu Geng 684ef871ee FIR: unify common special names scattered around the code base 2021-08-06 22:57:17 +03:00
Ivan Kochurkin 1a40164ef0 [FIR] Fix resolving of single underscore _
Now compiler throws `UNRESOLVED_REFERENCE` here:

```
val boo = { _: Exception -> `_`.stackTrace }
```
2021-07-30 16:58:07 +00:00
Mikhail Glukhikh 84bd347841 Make EXPERIMENTAL_API_USAGE_ERR warning till 1.6 for signature type case 2021-07-27 14:58:56 +03:00
Alexander Udalov 0a9498f7e2 Build: suppress deprecated JVM target warning globally
There seems to be no point in configuring the compiler argument per
project. This argument will be deleted soon anyway, when we remove
support for JDK 1.6 & 1.7.

Also remove `disableDeprecatedJvmTargetWarning`. It didn't have any
effect in all modules where it was applied because these modules
reassign `freeCompilerArgs` anyway, with
`-Xsuppress-deprecated-jvm-target-warning` in it.
2021-07-27 13:35:39 +02:00
Mikhail Glukhikh cb847b945d FIR: use getAnnotationByClassId instead of getAnnotationByFqName 2021-07-23 23:58:59 +03:00
Dmitriy Novozhilov 48a25e2fe6 [FIR] Add some status utils over symbols to addition to utils over fir 2021-07-13 10:31:30 +03:00
Dmitriy Novozhilov b2c6dd8d53 Convert ClassKind.java to Kotlin 2021-07-13 10:31:29 +03:00
Dmitriy Novozhilov 0062f1ba27 Rename ClassKind.java to ClassKind.kt 2021-07-13 10:31:28 +03:00
Victor Petukhov 9e48ef85ea Add tests for inferring self types from Java 2021-07-09 19:21:22 +03:00
Victor Petukhov c2cf2f36cd Implement inferring materialized self types through a default type in ResultTypeResolver 2021-07-09 19:21:04 +03:00
Victor Petukhov 51c5a54e31 Support type inference for self type materialization calls 2021-07-09 19:20:54 +03:00
Victor Petukhov 8de05691a9 Revert "Move fqname related stuff into core:util.runtime module"
This reverts commit e651e1c6
2021-07-06 09:54:28 +03:00
Victor Petukhov 205087cae3 Move fqname related stuff into core:util.runtime module 2021-07-06 09:54:23 +03:00
Yahor Berdnikau 7789054547 Migrate repo to use JVM toolchains Gradle feature.
^KT-46972 Fixed
2021-07-05 14:11:12 +00:00
Victor Petukhov 4aeabb6b0f Use upper bound aware type approximator for intersection types inside sam types in contravariant positions to build proper types in terms of subtyping 2021-06-22 21:13:55 +03:00
Ivan Kochurkin a0aaf42fb1 Some string and minor optimizations 2021-06-17 13:49:08 +03:00
Victor Petukhov 1b82227308 Don't do new captured type specific checks for old ones in the type checker
^KT-47143 Fixed
2021-06-15 10:07:20 +03:00
Mikhail Glukhikh ceb527c5e4 FIR: add OptIn checkers draft + some annotation / SinceKotlin utilities 2021-06-11 22:03:32 +03:00
Mikhail Glukhikh 0972020324 Extract common parts from ExperimentalUsageChecker 2021-06-11 22:03:32 +03:00
Tianyu Geng 97ea37c82f FIR: add smartcast stability to FIR 2021-06-10 16:01:09 +03:00
Mikhail Glukhikh fa307a5f75 Drop LocalCallableIdConstructor OptIn-annotation 2021-06-08 11:37:24 +03:00
Victor Petukhov 1e5998e0ba Add constraints between two different stub variables instead of creating constraint error due to T1 isn't subtype of T2
^KT-44241 Fixed
2021-06-03 19:18:09 +03:00
Dmitriy Novozhilov 6f54e9fd5c Revert "FIR: add smartcast stability to FIR"
This reverts commit 96bd2c54
2021-06-03 09:54:02 +03:00
Tianyu Geng 96bd2c54f0 FIR: add smartcast stability to FIR 2021-06-02 13:19:12 +03:00
Mads Ager f846dd8ea2 [JVM_IR] Avoid using special names in static inline class replacements.
Fixes KT-46952
2021-06-01 16:22:14 +02:00
Victor Petukhov 0c427555cf Support definitely not null stub types and proper subtyping on them 2021-05-28 15:36:19 +03:00
Victor Petukhov 5a11450d77 Split stub types into stub type for subtyping and for builder inference and use them in the proper way 2021-05-28 15:36:17 +03:00
Victor Petukhov ac7b459f2a Do subtyping with stub types properly
1) Return stub type if we are calculating super type between two same stub types
2) Return nullable Any if those stub types are different
2021-05-28 15:36:15 +03:00
Tianyu Geng e1b542314a FIR IDE: quickfix for WrapWithSafeLetCall
There is some behavior change regarding the new WrapWithSafeLetCall quickfix

1. it now works correctly on binary expressions by wrapping it with `()`
2. it now looks for a nullable position upward and do the modification there,
   if possible. For example, consider the following code

   ```
   fun bar(s: String): String = s

   fun test(s: String?) {
     bar(bar(bar(<caret>s)))
   }
   ```

   After applying this fix, FE1.0 yields

   ```
   bar(bar(s?.let { bar(it) }))
   ```

   while the new implementation yields

   ```
   s?.let { bar(bar(bar(it))) }
   ```

   This behavior aligns with FE1.0 if `bar` accepts nullable values.
2021-05-20 20:33:00 +02:00