Commit Graph

39323 Commits

Author SHA1 Message Date
Xin Wang 1b776bd5b6 JVM_IR: Specialize iterator if possible
fixes KT-47171
2022-02-28 01:39:31 +01:00
Roman Golyshev fed08aaff5 FIR IDE: Consider COMPANION_GENERATION phase in lazy resolve 2022-02-25 23:08:26 +03:00
Roman Golyshev ffcbc583d0 FIR: Split EnvironmentConfigurator to an interface and abstract class
It is needed to make it easier to write wrappers for configurators
2022-02-25 23:08:26 +03:00
Roman Golyshev f700b87f6c FIR: Prevent registering compiler plugins twice 2022-02-25 23:08:25 +03:00
Roman Golyshev 765af5f18a FIR IDE: Register plugins-related session components in IDE session
Move registering CLI-specific plugin-related components to
`registerCliCompilerOnlyComponents`
2022-02-25 23:08:25 +03:00
Roman Golyshev 029331c23b FIR: Introduce AbstractFirRegisteredPluginAnnotations
It will be needed to implement an alternative implementation of this
service
2022-02-25 23:08:25 +03:00
Ilya Kirillov 4a5aee688e FIR LC: fix invalid type param upper bound 2022-02-25 14:06:05 +01:00
Ivan Kochurkin c03886ecda Move IgnoreNullabilityForErasedValueParameters to 1.8 2022-02-25 11:46:27 +00:00
Mikhail Glukhikh 53d6ac24e5 Switch kotlin version to 1.7
* Change 1.6 to 1.7 constants
* Fix SAFE_CALL_WILL_CHANGE_NULLABILITY for testData
* Change EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_WARNING to EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR_ERROR
* Change NON_EXHAUSTIVE_WHEN_STATEMENT to NO_ELSE_IN_WHEN
* Fix testData for SafeCallsAreAlwaysNullable
* Change T -> T & Any in test dumps
* Change INVALID_CHARACTERS_NATIVE_WARNING -> INVALID_CHARACTERS_NATIVE_ERROR
* TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_WARNING -> TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR
2022-02-25 11:46:27 +00:00
Dmitry Petrov a1db077af9 JVM_IR KT-51458 fix DNN types handling in JvmStringConcatenationLowering 2022-02-25 10:09:14 +03:00
Igor Yakovlev f0f94623f4 [WASM] Implement data class hashCode and toString for arrays 2022-02-24 20:15:15 +03:00
Jinseong Jeon 1b6ded6005 FIR/LC: create synthetic members of enum class
^KTIJ-17414 In Progress
^KTIJ-17444 In Progress
2022-02-24 17:51:50 +01:00
Jinseong Jeon 790f2d13ae RAW FIR: record non-null value parameter of Enum#valueOf upfront 2022-02-24 17:51:50 +01:00
Jinseong Jeon 476e65f934 Utilize MemberScope.findFirstFunction with name and predicate 2022-02-24 17:51:49 +01:00
Jinseong Jeon 2599c1dbb6 FIR: use StandardNames (instead of hardcoded constants) 2022-02-24 17:51:48 +01:00
Jinseong Jeon 3651c4984a PSI2IR: use StandardNames (instead of hardcoded constants) 2022-02-24 17:51:48 +01:00
Alexander Udalov b443848ea0 Fix type table serialization in DescriptorSerializer
Always serialize type table (and version requirement table) after
everything else, to prevent bugs like KT-51446 where inline class
underlying type was added to the type table after it has already been
serialized.

 #KT-51446 Fixed
2022-02-24 16:34:25 +01:00
Alexander Udalov c53d91bae1 JVM IR: adjust generation of linenumber for try-finally
Do not generate linenumber for the start of the finally block, because
that is usually where the only word 'finally' is located. Instead,
generate linenumber for the first expression inside the finally block.

Not generating this linenumber fixes an issue in code coverage tools
which would consider such finally uncovered. Although this might be
technically considered as designed, it makes more sense to NOT detect it
as uncovered because semantics of the finally block shouldn't really
differ whether it's executed normally or because an exception happened.
It's also beneficial for the tool support to behave like javac, which
doesn't generate the linenumber either.

 #KT-50973 Fixed
2022-02-24 16:33:40 +01:00
Igor Chevdar 838743bf07 [box-tests] Ignored test for K/N
It will fail in Kotlin 1.7
2022-02-24 15:20:14 +03:00
Igor Chevdar d51eb32c62 [IR] Fixed IrType.classifierOrNull
Supported IrDefinitelyNotNullType explicitly for now
(later it will be better to handle it at the call sites)

Co-authored-by: Svyatoslav Scherbina <svyatoslav.scherbina@jetbrains.com>
2022-02-24 15:20:13 +03:00
Dmitry Petrov 287d988301 JVM minor simplification in CCE 2022-02-24 10:06:48 +00:00
Dmitry Petrov 872b81ac8a JVM prune exception edges in DFA in some cases 2022-02-24 10:06:47 +00:00
Dmitriy Novozhilov faba9c4272 [CLI] Don't register classpath roots twice
There are two ways how content roots are registered in compiler configuration
  in JVM CLI compiler:
1. Directly from arguments
2. From Module, which build from arguments

And there was a problem that both ways used at the same time in some
  circumstances (regular compilation without .xml module file) which
  caused duplication of all content roots.

Ideal solution for this problem is removal of Module usages at all,
  because it looks like redundant abstraction which just complicate
  things, but it's too scary to remove it, because it hove some none
  trivial usages inside compiler. So to fix problem with duplicated
  roots this commit just removes registration of roots from arguments
  if Module is used
2022-02-23 19:33:51 +03:00
Ivan Kochurkin f751f13c4d [FIR] Fix incompatible KClass<Any> and callable reference Collection::class, ^KT-51272 Fixed 2022-02-23 14:21:59 +03:00
Ivan Kochurkin 31d9313c51 [FIR] Fix "Expected some types" exception, ^KT-51274 Fixed 2022-02-23 14:21:59 +03:00
Ivan Kochurkin 6a3b7a9f91 [FIR] Ignore fake functions in FirExposedVisibilityDeclarationChecker ^KT-51229 Fixed 2022-02-23 14:21:58 +03:00
Ivan Kochurkin 73b45a1254 [FIR] Report UNSUPPORTED on array literals not from annotation classes ^KT-50750 Fixed 2022-02-23 14:21:57 +03:00
Ivan Kochurkin 19285d0569 [FIR] Fix false positive EXPOSED_PARAMETER_TYPE on internal val in constructor of sealed class ^KT-51200 Fixed 2022-02-23 14:21:57 +03:00
Dmitry Gridin 261cac7514 [light classes] avoid resolve in equals
^KTIJ-21209
2022-02-23 11:13:44 +07:00
Ilmir Usmanov 8811f62300 Fix mapping of nullable generic underlying types of inline classes
#KT-32162 Fixed
2022-02-23 01:23:07 +03:00
Mikhail Glukhikh 981f8b1871 FIR: implement resolve of unqualified enum references in when
See KT-16768
2022-02-22 22:13:06 +03:00
Ilya Goncharov 637d45c539 [IR] Disable rename of inline symbols
Merge-request: KT-MR-5801
Merged-by: Ilya Goncharov <Ilya.Goncharov@jetbrains.com>
2022-02-22 15:59:02 +00:00
Svyatoslav Scherbina 0c24f67c21 Native: fix location offsets in SuspendFunctionN implementations
When generating synthetic Function{N+1}.invoke implementations for
SuspendFunction{N} subclasses, use SYNTHETIC_OFFSET instead of
suspend invoke function location offsets.

This location is more suitable for generated synthetic functions.
Additionally, this fixes the case when suspend invoke is fake override:
fake overrides use UNDEFINED_OFFSET, so the generated function was
getting UNDEFINED_OFFSET as well, leading to incorrect debug
information.

Fix suspendFunctionAsSupertype.kt and suspendFunctionAsSupertypeCall.kt
2022-02-22 11:34:28 +00:00
Mikhail Glukhikh 8274c43ee6 Make useExperimental non-CLI argument 2022-02-21 22:32:53 +03:00
Alexander Udalov 96ba4bb201 Add test to check that KT-30172 is fixed 2022-02-21 20:31:05 +01:00
tdn120 8d1fb7bb5e Check analysis error before checking compiler args
ExperimentalUsageChecker.checkCompilerArguments() will crash if there was an error running analyze().
This checks for the error first so it can be properly reported.
2022-02-21 20:31:05 +01:00
Alexander Udalov 8ccd4a40d2 IR: rename IrElementVisitorVoid.visitVariableAccess -> visitValueAccess
For consistency with IrElementVisitor.

Co-authored-by: mcpiroman <mcpiroman@gmail.com>
2022-02-21 19:56:45 +01:00
Alexander Udalov b00cd30e93 IR: minor, move accept from IrConstantObjectImpl to IrConstantObject 2022-02-21 19:56:45 +01:00
Alexander Udalov 0b6972edf0 IR: add default implementations for acceptChildren/transformChildren
To simplify migration to auto-generated IR.
2022-02-21 19:56:45 +01:00
Alexander Udalov 4bec1b08f9 IR: move IrElement.transform implementation to IrElementBase
To avoid extra indirection via `IrElement$DefaultImpls` for elements
whose `transform` uses the default implementation. And also, to simplify
migration to auto-generated IR tree.
2022-02-21 19:56:44 +01:00
Alexander Udalov 2ce91853ec IR: minor, extract declarations from IrElement.kt 2022-02-21 19:56:44 +01:00
Alexander Udalov 1303ac4848 IR: make IrGetValue.copyWithOffsets an extension function 2022-02-21 19:56:44 +01:00
Ilmir Usmanov c072448d22 Lower fun interface children's body during inline class lowering
#KT-51121 Fixed
2022-02-21 19:50:12 +03:00
Mikhail Glukhikh 570189e833 Mark deprecated 'useExperimental' with IDEAPluginsCompatibilityAPI 2022-02-21 14:33:10 +00:00
Simon Ogorodnik 2a7aa2f240 FirTypeResolver. Prohibit resolving FirResolvedTypeRef 2022-02-21 12:23:26 +00:00
Simon Ogorodnik bf3a3caee6 FIR. Do not re-resolve parts of intersection types 2022-02-21 12:23:26 +00:00
Simon Ogorodnik 857fe985b2 FIR tree. Make intersection type part-types non-null 2022-02-21 12:23:25 +00:00
Simon Ogorodnik 9c727e6d5d FIR. Fix currentFile unset in specific type resolver in some cases 2022-02-21 12:23:25 +00:00
Alexander Udalov e5e5970883 JVM IR: workaround indirect dependency between lowerings
#KT-51353 Fixed
2022-02-18 17:04:18 +01:00
Dmitry Petrov 3b3734f0bb JVM_IR simplify RenameFieldsLowering 2022-02-18 15:37:42 +00:00