Commit Graph

523 Commits

Author SHA1 Message Date
Dmitriy Novozhilov dceb8b2991 [FIR] Don't render ! at the end of ConeFlexibleType 2021-03-11 13:10:05 +03:00
Dmitriy Novozhilov 65ea4e184a [FIR] Fix enhancement of FlexibleNullability and EnhancedNullability
- Add utilities to add new attribute to ConeAttributes
- Get rid of FlexibleNullability attribute (it can be easily inferred
    for any flexible type at any moment)
- Fix determining of EnhancedNullability attribute
2021-03-11 13:10:04 +03:00
Denis.Zharkov 45018ea468 FIR: Rework loading overrides of special built-in methods from Java
Some of the changed data is correct, but some diagnostics are incorrect
Corner cases like having both contains(Object) and contains(String)
within implementation of Collection<String> is not supported
2021-02-20 10:59:21 +03:00
Alexander Udalov 899f75466d Remove tests on kotlin-annotations-android
#KT-44815
2021-02-15 17:23:44 +01:00
Dmitriy Novozhilov f3a8fcaea6 [FE] Make constructors of sealed classes protected instead of internal 2021-02-12 13:36:38 +03:00
Ilya Gorbunov 87e130e77a Remove obsolete diagnostics suppression
The diagnostic NON_PUBLIC_PRIMARY_CONSTRUCTOR_OF_INLINE_CLASS is now
obsolete because internal constructors of inline classes became allowed.
2021-02-03 18:23:53 +03:00
Dmitriy Novozhilov ee1aff1012 [Test] Update different testdata according to changes in sealed classes 2021-01-28 13:19:29 +03:00
Mikhail Glukhikh 94e613dd01 FIR: support custom annotation-based type attributes 2021-01-23 10:56:42 +03:00
Ilmir Usmanov 129de76288 Value classes: Generate @JvmInline annotation for inline classes
but not for value classes.
Since inline classes and value classes share the same flag, we use
presence of the annotation to distinguish them.
2020-12-01 23:45:47 +01:00
Ilmir Usmanov ca3e7cf1a7 Value classes: Report lacking @JvmInline only on JVM backend
Report when @JvmInline is applied on non-value class.
2020-11-27 23:52:07 +01:00
Jinseong Jeon fc7f589caa FIR Java: record Java types with flexible nullability 2020-11-18 13:06:46 +03:00
Jinseong Jeon 46cc01602e FIR2IR: add implicit NOT_NULL cast if needed 2020-10-22 10:51:20 +03:00
Mikhail Glukhikh 44ebec05bb FIR Java: support read of field constant initializers 2020-10-02 08:57:39 +03:00
Denis Zharkov 9914b487b7 FIR: Do not load hashCode/toString/equals methods from Java interface
As it's done in FE 1.0, and there are subtle semantics in the language that depends on it
2020-10-01 17:49:02 +03:00
Dmitriy Novozhilov 4ef57c120f [FIR] Consider variance of type parameters during java type enhancement
#KT-41940 Fixed
2020-09-24 15:43:20 +03:00
Dmitriy Novozhilov bc1fa8ed7f [FIR] Add constructor for java annotations 2020-08-04 08:59:14 +03:00
Ivan Kylchik dcae6f1415 [FIR] Support when exhaustiveness for java enum
The problem appear because for java enum its entries was represented by
FirJavaField. To fix this FirEnumEntry was used

#KT-39621 Fixed
2020-07-09 23:49:54 +03:00
Denis Zharkov 4d484dd971 FIR: Support java array in type argument
^KT-37321 Fixed
2020-06-03 10:43:37 +03:00
Alexander Udalov 4520e02bae Support fun interfaces in kotlinx-metadata
#KT-37421 Fixed
2020-05-27 23:29:12 +02:00
Dmitriy Novozhilov 3acb64c536 [FIR] Add flexible default upper bound for java type parameters 2020-03-27 10:17:12 +03:00
Dmitriy Novozhilov 7bfe7061e7 [FIR] Add proper nullability for java enums 2020-03-20 23:11:28 +03:00
Denis Zharkov e1312a752a FIR: Allow a field override another field with the same name 2020-03-17 16:33:48 +03:00
Mikhail Glukhikh e051251b27 FIR: set isOperator only for Java methods with appropriate names
#KT-35133 Fixed
2020-02-19 18:09:04 +03:00
Denis Zharkov 2ad8488e6a FIR: Rewrite Java type mapping
Previoisly, there were two places where mapping had happened:
- toConeKotlinTypeWithNullability
- enhancePossiblyFlexible

The first one was used for supertypes and bounds and the second one
was used for other signature parts

The main idea is to perform type mapping once to a flexible type,
and then use it as it's needed (it's lower bound, or for the further ehnancement)

Also, this commit fixes flexibility for type arguments, see the tests
2020-02-19 15:53:34 +03:00
Denis Zharkov 95b4fa4b31 FIR: Support flexible types in getErasedVersionOfFirstUpperBound 2020-02-12 16:05:11 +03:00
Mikhail Glukhikh 91b432b4a1 [FIR] Java super-type arguments are now handled as flexible 2020-02-03 16:45:19 +03:00
Alexander Udalov 3c4e5d7615 Fix JvmFieldInInterfaceCompanion.kt for language version 1.4
Since 1.4, constant value is no longer written to the class file (and
thus cannot be read) for non-const properties. But in sources,
corresponding property descriptors still have the initializer which is
rendered to text. Therefore we disable the source-vs-binary check and
update the test data to check the new behavior.
2020-01-17 20:35:46 +01:00
Alexander Udalov de683c0768 JVM IR: mute more tests after advancing language to 1.4 2020-01-17 12:47:20 +01:00
Mads Ager 98f5c5aa95 JVM_IR: Preserve annotations on inline class replacement methods. 2020-01-03 16:44:50 +01:00
Dmitriy Novozhilov 5dfe100ae5 Allow use reference to reified type parameters in contracts since 1.4 2019-12-26 17:43:28 +03:00
Dmitriy Novozhilov f083edfac2 Allow contracts on final non-override members since 1.4 2019-12-26 17:43:27 +03:00
Denis Zharkov e89c777fc6 FIR: Create DefinitelyNotNull only for annotated types 2019-12-10 14:21:21 +03:00
pyos e4b1599457 JVM_IR: do not erase constant non-static field initializers...
...unless in 1.4 mode.
2019-11-29 16:49:52 +01:00
Denis Zharkov f659dc0bea FIR: Add synthetic values/valueOf methods to Java classes 2019-11-27 11:20:52 +03:00
Mads Ager 8d5e5210a6 JVM_IR: Copy annotations to suspend function views. 2019-11-26 21:00:50 +03:00
Dmitriy Novozhilov 950d1f4fe4 [FIR] Fix enhancement of java array type 2019-11-19 10:43:46 +03:00
Mikhail Glukhikh bd70daa3d1 FIR Java: use definitely not-null types for type parameters
We support & use ConeDefinitelyNotNullType more properly here
2019-11-14 19:10:59 +03:00
Alexander Udalov 57a674e9e6 Make fast class files reading mode default in compiler tests
This makes sense because this mode is the default in the production
compiler. Forgetting to enable it where necessary led to different
bizarre test failures, see for example changes around 3fee84b966 and
KT-34826
2019-11-11 15:40:49 +01:00
Mikhail Glukhikh c657d46437 FIR Java: add nullable (instead of not-null) type parameter bounds 2019-11-11 17:07:57 +03:00
Mikhail Glukhikh db11c14fee FIR Java: don't add type parameter bounds multiple times 2019-11-11 17:07:57 +03:00
Steven Schäfer f9ff3771e5 JVM IR: Avoid getTopLevelClass in AddContinuationLowering 2019-11-07 13:48:43 +01:00
Dmitriy Novozhilov 25e853606e [FIR] Add deserialization of inheritors of sealed classes 2019-10-17 16:20:59 +03:00
pyos d3992826e4 JVM_IR: discard parameter annotations in anonymous object constructors 2019-10-14 14:54:44 +02:00
Dmitriy Novozhilov e6bf3b3263 [FIR] Render nullability in type renderer, not in fir renderer 2019-08-22 10:55:07 +03:00
Mikhail Glukhikh 2ceffa241b FIR: make Java default constructor visibility same with class visibility 2019-07-11 12:38:53 +03:00
Steven Schäfer 917ef250cf Add and (un)mute inline class tests 2019-06-13 12:25:06 +02:00
Mads Ager 71604851fe JVM_IR: Allow delegated companion objects.
This currently leads to a compilation error due to metadata
generation.
2019-06-07 13:26:20 +02:00
Mikhail Zarechenskiy 787a8bb9bd Revert "[NI] Disable capturing/approximation type in TypeSubstitutor with enabled NI"
This reverts commit 7c4101e21c.

 #KT-31866 Fixed
 #KT-31868 Fixed
 #EA-125401 Fixed
 #KT-25290 Open
2019-06-07 12:31:38 +03:00
Dmitriy Novozhilov ef91960fe9 [NI] Fix testdata after enabling NI in IDE tests 2019-06-03 12:13:31 +03:00
Mads Ager dc5f4ab240 Add annotation to static methods on DefaultImpls. 2019-05-29 15:37:09 +02:00