Commit Graph

147 Commits

Author SHA1 Message Date
Pavel Kunyavskiy 733ca5a358 [K/N] Unmute tests already working on native
Also, add issue references for some tests
2023-06-06 14:29:21 +00:00
Alexander Udalov b8785fbd90 K2: do not support disabling NoSourceCodeInNotNullAssertionExceptions
Disabling of this language feature (see KT-57570) was not supported in
the (default) light tree mode, and after this change it will not be
supported in the PSI mode as well. This makes the behavior more
consistent and allows us to remove the directive
IGNORE_BACKEND_K2_LIGHT_TREE in the future (KT-56757).
2023-06-06 10:06:39 +00:00
Alexander Udalov fc0ce415d7 JVM: remove source code from not null assertion message text
This is implemented under a LanguageFeature which will be enabled later,
when behavior change described in KT-57570 is approved.

 #KT-57570
2023-04-28 10:26:15 +00:00
Kirill Rakhman e0baeb53db [FIR] Fix substituted synthetic property with overridden getter only
When building the original for a substitution override for a synthetic
property, use the initial setter as fallback when unsubstituting it
returns null. This can happen when a generic class overrides the getter
of a synthetic property of a non-generic class. Then the setter is never
substituted, therefore there is nothing to unsubstitute.

^KT-57168 Fixed
2023-03-08 08:35:02 +00:00
Dmitriy Novozhilov 49f15a16ce [Test] Mute tests due to KT-56760 2023-02-20 08:40:32 +00:00
Kirill Rakhman 7f8dc56d36 [FIR2IR] Don't generate fake overrides for clashing synthetic properties
If a synthetic prop clashes with a real property (e.g. @JvmField
property from parent Kotlin class), don't generate fake override for the
synthetic property. This fixes a CONFLICTING_INHERITED_JVM_DECLARATIONS
error in a mixed hierarchy.

^KT-56538 Fixed
2023-02-15 10:10:31 +00:00
Mikhail Glukhikh d436d56871 FE: add some more tests around static field fake overrides 2023-01-26 15:27:58 +00:00
Artem Kobzar 71486a321c [K/JS] Add support of compilation with ES-classes 2023-01-17 18:14:17 +00:00
Denis.Zharkov fd7559893e Fix deserialization exception for DNN types from Java
useCorrectedNullabilityForTypeParameters = true only might lead
to something becomes a DNN when otherwise it wasn't.

It seems safe to use it here, since if compiler has generated DNN, then
it's OK to assume that it checked necessary conditions, and it's likely
that it had useCorrectedNullabilityForTypeParameters = true as well, there.

Anyway, it looks saner than having an exception here.

Also, we assume here that metadata leading to exception might only be generated
with ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated LF
(at least, we don't have contradicting evidences),
thus it's mostly a preparations in case we decide to enable
ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated in 1.9.

^KT-55357 Fixed
^KT-55388 Related
^KT-36770 Related
2022-12-12 12:42:14 +00:00
Denis.Zharkov 9e8e5c5a36 Make sure that fix for KT-53041 works with additional LF
Previously, it worked by default because ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
was enabled by default since 1.8, but we have to disable it because of KT-55357

Turning off the fix by default is not a breaking change per se, because
1.8 has not yet been released.

^KT-55357 Related
^KT-36770 Related
^KT-53041 Open
2022-12-12 11:39:05 +00:00
Ilya Chernikov 78ca733c38 FIR JS: add K2 variants of all other JS tests
except tests that are not possible to add without some modifications in
the test infra. See todos on the commented-out test declarations
2022-11-12 16:28:24 +01:00
Ilya Chernikov 5b3816cce5 Test infra: refactor IGNORE_BACKEND directive
treat it as a general one, introduce *_K1 and *_K2 variants for
more specific ignoring
2022-11-12 16:28:23 +01:00
Victor Petukhov 7d945d9bdc [FIR] Support loading rxjava3 nullability annotations on bounded wildcards
^KT-53041 Fixed
2022-07-11 12:44:08 +00:00
Victor Petukhov cb2dbca0c3 [FE 1.0] Support loading rxjava3 nullability annotations on bounded wildcards
^KT-53041 Fixed
2022-07-11 12:44:07 +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
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00
Alexander Udalov 1071919706 Remove backend tests on old inference
Also remove any mentions of NewInference, and rename some tests.
2021-11-09 20:07:33 +01:00
Victor Petukhov 43e9c1223a Take into account possible passed old captured type in isCapturedTypeFromSubtyping check
^KT-48590 Fixed
2021-10-26 19:37:55 +03:00
Dmitry Petrov 3d64c91375 PSI2IR KT-49053 skip fake overrides with unresolved types in signature 2021-10-06 16:23:08 +03:00
Svyatoslav Kuzmich c88cde2f8b [Wasm] DONT_TARGET_WASM_BACKEND => IGNORE_BACKEND in testdata 2021-10-02 06:14:35 +00:00
Svyatoslav Kuzmich ab9a23cbfa [Wasm][Stdlib] Reuse K/N collections and StringBuilder 2021-10-01 17:18:49 +03:00
pyos 8ff79e002e FIR: load parents of Java inner classes first, as before 2021-09-14 19:00:44 +03:00
Denis.Zharkov c23de2dae8 FIR: Unignore test on StrictJavaNullabilityAssertions
^KT-48302 Fixed
2021-08-31 15:41:18 +03:00
Mikhail Glukhikh bbb76aae3f Provide more precise check for ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED
#KT-47542 Fixed
2021-08-24 12:32:30 +03:00
Denis.Zharkov a8077aebb0 FIR: Ignore suspicious test on StrictJavaNullabilityAssertions
^KT-48302 Open
2021-08-17 21:38:01 +03:00
Mikhael Bogdanov 235359e028 Ignore tests cause of KT-47542
#KT-47542
2021-07-29 19:45:54 +02:00
Mikhael Bogdanov 7cbd6908f9 Update test affected by ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated feature 2021-07-29 19:45:53 +02:00
Denis.Zharkov 4892ad42b9 FIR: Do not mark not found classes' based types from Java as error
The same happens in FE1.0
2021-06-24 12:17:45 +03:00
Mark Punzalan 21a3a14289 FIR: Use intersection of all upper bounds for parameterized types in
ConeKotlinType.canBeNull.

^KT-45903 In progress
2021-04-14 19:17:10 +03:00
Denis.Zharkov 1f074326bf FIR: Fix Java scope in case of accessor with getter signature from supertype
^KT-45584 Fixed
2021-03-31 15:57:02 +03:00
Dmitriy Novozhilov e00e726bcb [FIR] Add test for KT-45584 2021-03-24 12:56:17 +03:00
Dmitriy Novozhilov f4afc2ef44 [FIR] Map dispatch receiver type of function in JvmMappedScope 2021-03-24 12:56:16 +03:00
Vasily Levchenko 0324ee508e [testData][compiler] disable tests KT4282{4,5} for native backend 2021-02-24 11:07:16 +01:00
Pavel Punegov 4643f12a5f Ignore JVM test in Native backend 2021-02-21 11:11:46 +03:00
Mikhail Glukhikh 94e613dd01 FIR: support custom annotation-based type attributes 2021-01-23 10:56:42 +03:00
Dmitriy Novozhilov 6a7cd0c811 [Test] Add ability to specify applicability of diagnostic to module or file 2021-01-22 13:51:19 +03:00
Denis.Zharkov 5f0d00a83f FIR: Use proper tower data contexts for postponed callable references
E.g., it should contain local scopes of containing lambdas
2021-01-21 18:53:03 +03:00
Denis.Zharkov acbf382d04 FIR: Add test on ambiguous vararg
Fix is in the two previous commits
2020-12-28 13:19:23 +03:00
Dmitry Petrov 4e261cc358 JVM_IR KT-24258 fix NPE message for delegated properties 2020-12-23 21:50:10 +03:00
Dmitry Petrov 443cd0fc2c Tests for issues fixed in JVM_IR 2020-12-22 16:07:06 +03:00
Jinseong Jeon f7ade2b0b8 FIR2IR: introduce implicit casts for extension receivers 2020-12-15 11:52:49 +03:00
Alexander Udalov 7b5544ebd3 Use -source/target 1.6 for Java sources in codegen tests
In cases when the test has the JVM_TARGET directive, use that one for
Java compilation as well.

Otherwise, for box tests, the corresponding test in `JvmTarget6OnJvm6`
(module `:compiler:tests-different-jdk`) will fail. However, it affects
all codegen tests, so fix a bunch of them which use Java 8+ features to
explicitly compile with JVM target 1.8. In particular, this obsoletes
the SKIP_JDK6 directive in those tests because "JVM_TARGET: 1.8" also
skips it for JDK 6.

The check for IS_SOURCE_6_STILL_SUPPORTED is needed in order to still be
able to run tests in the project while only having a single JDK > 11
installed, and having all of the env vars JDK_16, JDK_17, JDK_18
pointing to that JDK.
2020-11-18 18:43:43 +01:00
Jinseong Jeon 4cb32cd38a FIR2IR: add implicit NOT_NULL cast for @FlexibleNullability type 2020-11-18 13:06:48 +03:00
Mikhail Glukhikh f2f00a4654 Fix BB test to work on JDK 6 2020-11-11 12:00:18 +03:00
Mikhail Glukhikh bc47a30dd3 [FIR] Handle 'EnhancedNullability' more properly
This commit includes three changes:
1. 'EnhancedNullability' is no more set for declaration types
2. It is no more used for conversion types in translator
3. Translator inserts implicit not-null cast only when enhanced type is cast to not-null type.
2020-11-10 21:07:27 +03:00
Mikhail Glukhikh f8e03786c0 Mute not relevant JS/WASM back ends for new BB tests 2020-11-10 21:07:09 +03:00
Juan Chen 9486f58fb1 [FIR] fix subtyping for definitely notnull types.
The current implementation doesn't consider Foo a subtype of Captured<in
Foo>!!, since AbstractTypeCheckerContext::checkSubtypeForSpecialCases
does not handle DefinitelyNotNullType cases. This PR adds handling of
DefinitelyNotNullType by looking at its original type.

^KT-42824 Fixed
2020-11-10 21:07:09 +03:00
Juan Chen eb804709da [FIR] fix subtyping for nullable captured types.
The issue is the type checker doesn't consider P? a subtype of
CapturedType<in P>?, whereas P a subtype of CapturedType<in P>?. In
AbstractTypeCheckerContext::checkSubtypeForSpecialCases, it checks if
P? is a subtype of the lower type of the captured type, which is
P, and returns false.

This fix uses nullable version of the lower type when the captured
type is marked nullable. To check if P? is a subtype of Captured<in
P>?, we check the LHS, P?, against the nullable lower type of RHS,
P?.

^KT-42825 Fixed
2020-11-10 21:07:09 +03:00
Dmitry Petrov 785466acee Minor: add '// JVM_TARGET: 1.8' 2020-11-10 06:48:07 +03:00
Svyatoslav Kuzmich fdd7fa5aea [Wasm] Mute codegen box tests 2020-11-09 16:04:43 +03:00