Commit Graph

863 Commits

Author SHA1 Message Date
Yahor Berdnikau 0cad069522 [Build] Pin api and language level to 1.8 in Kotlin compiler modules used by KGP
This is required to be able to compile KGP and it's dependencies which
set LV to 1.4 when repo will use LV 1.9. This caused by the change how
enums are compiled (KT-48872).
2023-02-18 13:26:54 +00:00
Alexander Korepanov 43cef114c6 [Compiler CLI] Sort flags and features before appending them to string
JS IR BE incremental compilation infrastructure uses
 LanguageVersionSettings::toString method to detect if any
 compiler features or flags were enabled or disabled.
 It is important that the features and flags order are stable
 in the result string.

^KT-56580 Fixed
2023-02-15 13:24:11 +00:00
Mikhail Glukhikh 7d8a1e9c1c Delay EnhanceNullabilityOfPrimitiveArrays to version 2.0
See KT-54521
2023-02-14 11:52:00 +00:00
Mikhail Glukhikh 81ac94b2d7 FE: convert LanguageVersion.versionString to a stored property
Suggested by Yuriy Artamonov
#KT-56276 Fixed
2023-02-08 12:51:21 +00:00
Svyatoslav Kuzmich e517df1533 [Wasm] Mark JsAllowImplementingFunctionInterface with OTHER kind
This fixes test failures when advancing bootstrap.

When a language feature has UNSTABLE_FEATURE kind, enabling it causes
the compiler to mark the compiled library with the pre-release flag.

JsAllowImplementingFunctionInterface feature is enabled by default in
Wasm backend. So effectively, all Wasm klibs are marked with the
pre-release flag, including the standard library.

Pre-release checks were enabled recently and cause compiler errors.

To fix the problem, this commit changes the feature kind to OTHER, which
doesn't enforce the pre-release flag.

Merge-request: KT-MR-8582
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2023-01-31 10:18:08 +00:00
Dmitriy Novozhilov 4c96495eef [FIR] Put new contract syntax under feauture flag
^KT-55171 Fixed
2023-01-31 07:53:09 +00:00
Marco Pennekamp d6cb75ca91 [LL FIR] KT-55329 Support transitive dependsOn dependencies in LL FIR
- In contrast to other kinds of dependencies, `dependsOn` dependencies
  must be followed transitively.
- Add `transitiveDependsOnDependencies` to `KtModule`. These
  dependencies are calculated lazily with a topological sort. They are
  added to the dependency provider when it's built in
  `LLFirSessionFactory`.

^KT-55329 fixed
2023-01-30 17:17:58 +00:00
Dmitriy Novozhilov 66544a4e00 Switch kotlin version to 1.9
with appropriate fixes in testdata, tests and other
places.
2023-01-30 09:29:55 +00:00
Mikhail Zarechenskiy 4dd7481ac3 Set Kotlin 1.9 and Kotlin 2.0 as ready for preview
^KT-56165
 ^KTIJ-24398
2023-01-25 13:09:38 +00:00
Mikhail Glukhikh 70fc891260 K2: move -Xuse-k2 VS language version checks to CommonCompilerArguments 2023-01-16 18:16:49 +01:00
Mikhail Glukhikh 17c434002a Move EnableDfaWarningsInK2 into experimental section until K2/IDE EAP
This commit means that we will not see K2 DFA warnings until
we explicitly enable them (probably in 1.9.20 or 2.0).
We are going to enable DFA warnings at the moment when
K2/IDE is accessible for external users
2023-01-16 18:12:55 +01:00
Mikhail Glukhikh 3dc05f4ec5 Introduce language version 2.0 and associate K2 compiler with it 2023-01-16 18:12:55 +01:00
Svyatoslav Scherbina 4db7bac4c0 Switch JsAllowValueClassesInExternals kind from UNSTABLE_FEATURE to OTHER
When a language feature has UNSTABLE_FEATURE kind, enabling it causes
the compiler to mark the compiled library with the pre-release flag.

JsAllowValueClassesInExternals feature is enabled by default in JS IR
backend. So effectively, all JS klibs are marked with the pre-release
flag. This remained unnoticed because the compiler currently doesn't
read this flag from klibs. This will change soon.

To fix the problem, this commit changes the feature kind to OTHER, which
doesn't enforce the pre-release flag.
2023-01-06 16:57:38 +00:00
Pavel Kunyavskiy 4928e284f6 Make LateinitIntrinsicApplicabilityChecker warning for Native and JS
This checker was enabled only on JVM by mistake.
It's now fixed, but we don't want to make it an error in minor release.
So it will be an warning in 1.8.20 and an error in 1.9.0

^KT-27002
2022-12-20 20:06:52 +00:00
vladislav.grechko 18edf43ec7 Disable 'InlineLateinit' feature in 1.9 language version
The feature is not ready to be shown in preview

^KT-55247: Fixed
2022-12-13 10:27:01 +00:00
vladislav.grechko eb87b726e2 Disable 'CustomEqualsInValueClasses' feature in 1.9 language version
The feature is not ready to be shown in preview

^KT-55246: Fixed
2022-12-13 10:27:01 +00:00
Denis.Zharkov d34bd2e8c0 Postpone ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
The main reason is a bug in deserialization(KT-55357) that doesn't allow
to deserialize some binaries compiled with that feature enabled.

While we might fix it in 1.8.0, it doesn't help because previous
compilers, e.g. 1.7.0 still may break when using freshly recompiled
libraries.

Considering, that almost any meaningful fix might look unsafe for
the almost released 1.8.0, we can't enable the feature even in 1.9,
because 1.8.0 compilers wouldn't read those libraries anyway.

So, effectively this feature will be only enabled in K2.

^KT-55357 Related
^KT-36770 Related
2022-12-12 11:39:04 +00:00
Evgeniy.Zhelenskiy abc1d942d1 [IR] Add tests for value classes secondary constructors with body and set language feature version for the feature
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-55333
2022-12-11 22:06:47 +01:00
Dmitriy Novozhilov 3cffb33ab7 [FE] Drop ApproximateIntegerLiteralTypesInReceiverPosition language feature
This feature is not needed because it is unconditionally disabled for K1
  (because of not fully correct implementation) and unconditionally enabled
  in K2 (K2 does not support old behavior)

^KT-38895
2022-12-09 15:10:02 +00:00
Pavel Mikhailovskii b4b05b7bf6 KT-8575 Enable references to synthetic Java properties in 1.9 2022-12-06 22:16:01 +00:00
Andrey Uskov c9e0100214 Remove experimental implementation of Kotlin Compiler Daemon
#KT-50846 Fixed
2022-12-05 16:02:03 +00:00
Evgeniy.Zhelenskiy 9f01ccc304 [IR] Support user-defined equals for MFVC
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:36 +00:00
Evgeniy.Zhelenskiy 6107caa8e2 [FE1.0, FIR] Support secondary constructors for Value Classes
Signed-off-by: Evgeniy.Zhelenskiy <Evgeniy.Zhelenskiy@jetbrains.com>

#KT-1179
2022-11-30 18:55:35 +00:00
Vladislav Grechko cd6e865fb3 Improve support of 'lateinit' modifier
- Allow 'lateinit' for inline classes which underlying type
is suitable for 'lateinit'

- K2: report all problems related to 'lateinit' modifier

^KT-55052: Fixed
2022-11-24 19:47:21 +00:00
Nikita Bobko 4f68684eba Postpone non-local break and continue feature till K2
Postpone because we found a bug KT-54906 in CFA/DFA in K1 which we are
not going to fix in K1

Meta-issue: KT-1436
2022-11-16 13:17:02 +00:00
Svyatoslav Kuzmich 78bd6dbdcd [Wasm] Allow implementing function interfaces 2022-11-14 11:23:18 +01:00
Alexander Korepanov d5e9e87538 [JS BE] Drop JS scripting support
JS scripting uses the old IR to JS transformer.
 The new IR to JS transformer can not be used for
 JS scripting out of the box. Patching the new transformer for
 JS scripting is potentially dangerous and requires a lot of effort.
 Dropping JS scripting and the old IR to JS transformer allows to
 refactor and simplify JS BE codebase.
2022-11-04 14:15:15 +00:00
Vladimir Dolzhenko 5dc2442872 Safe reporting PSI elements in KEWA 2022-11-03 17:27:11 +00:00
Nikita Bobko a926edd845 Disable ReferencesToSyntheticJavaProperties until the KEEP document is approved
KEEP document: https://github.com/Kotlin/KEEP/pull/329
2022-11-03 12:02:59 +00:00
Denis.Zharkov f95bfccf59 K1: Prolong deprecation for KT-46727
The language committee ticket has not yet been prepared
2022-11-01 12:03:26 +00:00
Nikita Bobko cdbfcdc465 Cleanup: LanguageFeature.defaultState -> LanguageFeature.isEnabledWithWarning
Review: https://jetbrains.team/p/kt/reviews/7418

`State` enum contains `DISABLED` item which is redundant for
`LanguageFeature`. It's redundant because `sinceVersion = null` is used
to express the same semantic.

I had to reorder some items in the enum because otherwise
`testLanguageFeatureOrder` fails. I could keep the same logic in
`testLanguageFeatureOrder` but I would need to make
`isEnabledWithWarning` public which I don't want to. Anyway, it's not
obvious what is more readable: keep `isEnabledWithWarning = true` items
at the end or at the beginning.

Also all effectively disabled features (`sinceVersion = null` or
`defaultState = State.DISABLED`) are now moved to the "Experimental"
section at the end which is obviously better.
2022-10-27 13:16:44 +02:00
Nikita Bobko 49a5186f15 Enable EnumEntries language feature by default
Related issue: KT-48872
Review: https://jetbrains.team/p/kt/reviews/7418

If we want to make the feature experimental then specifying
`sinceVersion` higher than the current compiler version is enough.
`defaultState = State.DISABLED` is redundant
2022-10-27 13:16:10 +02:00
Nikita Bobko 4e69d1248a Cleanup: drop unused LanguageFeature.State.ENABLED_WITH_ERROR
Review: https://jetbrains.team/p/kt/reviews/7418
2022-10-27 13:16:10 +02:00
Mikhail Glukhikh 8e48636b29 K1: don't report assignment TYPE_MISMATCH in BI under feature ON
Related to KT-54004
2022-10-26 09:21:48 +00:00
pyos 6c6d653e85 FE: don't lose annotations on Java primitive arrays
but only use them to enhance for warnings for now.

^KT-48861 Fixed
2022-10-26 09:33:40 +02:00
Ilya Chernikov b50a803b6f Make jdk root processing more robust
#KT-54337 fixed
2022-10-21 06:11:42 +00:00
Mikhail Glukhikh bd3e3e2524 Make some features targeting 1.8/1.9 bug fixes (was forgotten before) 2022-10-19 17:24:46 +00:00
vladislav.grechko 817afcd4af KT-MR-7307 review fixes 2022-10-13 15:19:10 +00:00
vladislav.grechko e0c8142106 Support of custom 'equals' and 'hashCode' in inline classes
'equals' from any made available for overriding in inline classes
'typed' equals made available for definition in inline classes
'typed' equals definition made compulsory if 'untyped' is overridden
'operator' keyword is allowed in 'typed' equals definition

^KT-24874: Fixed
2022-10-10 16:52:34 +00:00
Pavel Mikhailovskii a209098a6c KT-8575 Enable ReferencesToSyntheticJavaProperties in 1.9 2022-09-22 20:20:55 +00:00
Mikhail Glukhikh b86722c523 FE: delay ForbidSuperDelegationToAbstractFakeOverride to 1.9
Related to KT-53953, KT-49017
2022-09-16 07:15:43 +00:00
Dmitriy Novozhilov b86d5cf21a [FE] Postpone ProhibitAccessToEnumCompanionMembersInEnumConstructorCall till 1.9
^KT-49110
2022-09-16 07:12:19 +00:00
Pavel Mikhailovskii f643cdf90b Target KT-4107 (data objects) to Kotlin 1.9 2022-09-15 12:23:40 +02:00
pyos adcbc5ec99 FE1.0: keep nullability when approximating local types (in 1.9)
Report an error that inference will change and type has to be provided
manually in other language versions, since the current behavior is an
unsoundness that can cause runtime NPEs while the new behavior may
silently change overload resolution.

^KT-30054 Fixed
2022-09-14 08:11:04 +00:00
Ivan Kochurkin 6c4dafc23c Disable IgnoreNullabilityForErasedValueParameters for indefinite time, ^KT-53751 Fixed 2022-09-13 16:45:06 +00:00
Mikhail Glukhikh 596ad7d7d3 FE: make EnumEntries unstable feature to poison binaries 2022-09-08 09:03:05 +00:00
Mikhail Glukhikh e52c50bfaa K2: postpone "Enable DFA warnings" to version 1.9
#KT-50965 Fixed
2022-09-07 08:05:20 +00:00
Simon Ogorodnik 4dd7437df1 Fix kind of NoBuilderInferenceWithoutAnnotationRestriction
BUG_FIX kind causes feature to enable in progressive mode, which
wasn't intended
2022-09-05 10:07:42 +00:00
Denis.Zharkov 3d7969ec8f Revert "KT-35811: Type parameter angle brackets followed by equal sign are parsed incorrectly if whitespace is missing"
This reverts commit 2053363def.

^KT-35811 Open
2022-08-30 11:21:50 +00:00
Denis.Zharkov 211d662708 Revert "KT-8263: Conditional operators are not parsed correctly"
This reverts commit ec8da2033c.

For the reason for the revert see KT-53719

^KT-8263 Open
^KT-53719 Fixed
2022-08-30 11:21:50 +00:00