Commit Graph

141 Commits

Author SHA1 Message Date
rapturemain 8960829c01 [FIR] Cast error on the element name instead of the whole body 2020-04-20 17:27:16 +03:00
rapturemain 6d63de01ac [FIR] Fix effective visibility calculation & relevant test data 2020-04-20 17:25:26 +03:00
Mikhail Glukhikh b27152f903 Replace some FIR syntax errors with more proper diagnostics 2020-03-27 16:46:59 +03:00
Vyacheslav Gerasimov bcefa68df0 Always checkout/checkin text files with lf endings
Different line endings on linux/windows prevents gradle from reusing
build cache since endings make task inputs completely different between
systems
2020-03-18 22:33:15 +03:00
Mikhail Glukhikh 8884cbe415 Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed 2020-03-05 09:39:40 +03:00
Mikhail Glukhikh 39bd97147f [FIR] Don't create initializers for simple enum entries
Usually FIR enum entry is initialized by anonymous object,
which is the container for all enum entry' declarations.
However, for simple enum entries there is no need of initializer at all.
2020-02-21 16:38:52 +03:00
Mikhail Glukhikh b1e9dbf994 [FIR] Use super<Enum> as delegated calls in enum constructors 2020-02-21 16:37:56 +03:00
Mikhail Glukhikh ace259314b Use 'symbol' instead of 'classId' in FirResolvedQualifier
This commit solves problem with resolved qualifier of local class
#KT-36758 Fixed
2020-02-19 22:41:23 +03:00
Ilya Chernikov 6356807997 Reapply "Only create descriptors for candidates with lambda args"
#KT-36247 fixed
A lot of testdata changed because significanly less (error) descriptors
are created for unresolved types, so diagnostics became different.
2020-02-14 11:41:30 +01:00
Mikhail Glukhikh 71b0840ef9 [FIR] Implement super resolve as a particular tower resolver case 2020-02-05 11:19:19 +03:00
Mikhail Glukhikh 14204a842a Refactoring & clarification: implement new FIR tower resolver 2020-01-27 00:34:16 +03:00
Simon Ogorodnik 13132e69a3 [FIR] Start enum entries reworking 2020-01-10 10:23:50 +03:00
Mikhail Glukhikh de50f8aef3 FIR resolve: add partial support of extension lambda calls
Here we introduce ONLY_IMPLICIT_RECEIVER tower level
to support extension lambda calls on local variables,
and soften extension receiver checks to make such extensions visible & applicable.
Also here we try to map arguments twice for functional types
2019-12-27 09:57:36 +03:00
Mikhail Glukhikh a8a50fa657 Fix raw FIR building with parenthesized expression as selector 2019-12-27 09:57:34 +03:00
Ilya Chernikov 8322398133 [minor] Fix testdata for compiler 1.4 2019-12-19 12:32:14 +01:00
Mikhail Glukhikh 9f1f743d55 FIR: fix test data after Make 'statics visible from nested classes' 2019-12-17 12:24:14 +03:00
Dmitriy Novozhilov 2536fa0cd5 [FIR-TEST] Add new testdata generated after changes in previous commit 2019-12-12 16:11:46 +03:00
Dmitriy Novozhilov b323298b0e [NI] Remove deep types in commosn super type for recursive types
#KT-30411 Fixed
2019-05-23 12:22:42 +03:00
Alexander Udalov d257285c86 Load Java enums as final classes
In case Java enum has an abstract member, it has the ACC_ABSTRACT flag
set in the bytecode. However, we should still load it with final
modality to be consistent with Kotlin enums which are always considered
final

 #KT-23426 Fixed
2019-04-10 14:39:16 +03:00
Mikhail Zarechenskiy c4b69b65bc Gradually prohibit comparison of incompatible enums
#KT-22043 Fixed
2019-03-05 13:33:23 +03:00
victor.petukhov 46bd5ba107 Add alphabetical sorting diagnostics with same ranges 2019-02-14 12:31:42 +03:00
Marcin Moskala 686cfa6fd2 Fix common misspellings 2018-12-21 16:13:42 +03:00
Denis Zharkov aa63ad4a45 Report a warning when comparing incompatible enums
I've put `isIncompatibleEnums` to TypeIntersector because I placed
all of its usages after all of the TypeIntersector::isIntersectionEmpty ones

^KT-28225 Fixed
2018-11-16 10:36:09 +03:00
Dmitry Savvinov 5cb949ad7f Fix language features in tests for gradual migration to 1.3 (part 2)
In 1.3, due to changes in language, testdata for some tests can be
different from 1.2

We want to simlultaneously test both versions, so instead of fixing
language version in such tests, we split them into two: one with fixed
1.2, another with fixed 1.3
2018-07-05 10:42:49 +03:00
Mikhail Glukhikh e76debb12b Report UNUSED_PARAMETER in setter #KT-21129 Fixed 2018-05-04 18:04:57 +03:00
Dmitry Savvinov ea72c76a37 [NI] Testdata changes after fixes in error types 2017-12-07 12:49:56 +03:00
Mikhail Zarechenskiy 328c67b9e8 Add separate diagnostic renderer results for tests with NI 2017-11-29 02:54:30 +03:00
Mikhail Zarechenskiy 8757298994 Add diagnostics to test data from NI 2017-11-29 02:54:26 +03:00
Mikhail Zarechenskiy a71238bf94 Place !WITH_NEW_INFERENCE directive to diagnostics test data 2017-11-29 02:53:49 +03:00
Denis Zharkov 2df4d9496a Fix incorrect UNINITIALIZED_ENUM_COMPANION diagnostic
#KT-20959 Fixed
2017-10-27 09:36:00 +03:00
Alexander Udalov 6e410cb182 Make TypeConstructor.isFinal return false for enums
The reason is that before dc02b2e3ab and 8a0dcca957,
TypeConstructor.isFinal for some class descriptors
(DeserializedClassDescriptor, LazyJavaClassDescriptor,
MutableClassDescriptor) were implemented as `isFinalClass` (which is
`modality == FINAL && kind != ENUM_CLASS`), and all others as
`modality == FINAL` or simply true/false. This led to differences in
behavior depending on the exact instance of the class descriptor.
Now that TypeConstructor.isFinal is always `modality == FINAL`, some
tests (PseudoValueTestGenerated) fail because the finality of some type
constructors changed and these tests render final vs non-final type
constructors differently.

In this commit, TypeConstructor.isFinal is now made to behave safer,
i.e. considering enum class type constructor to be non-final (as was the
case earlier for some ClassDescriptor instances). Some diagnostics might
disappear (e.g. FINAL_UPPER_BOUND) but it doesn't look like a big deal
2017-10-18 12:45:45 +02:00
Dmitry Petrov 4428798c61 Change diagnostic message and rename to NESTED_CLASS_DEPRECATED 2017-09-11 09:42:18 +03:00
Dmitry Petrov ba2c3136bb Prohibit non-inner classes in enum entries since 1.3 2017-09-11 09:42:18 +03:00
Alexander Udalov 9471f33c38 Refactor getDefaultSupertype, drop obsolete diagnostic 2017-06-20 14:39:47 +03:00
Dmitry Petrov 902d3af280 Prohibit extending kotlin.Enum directly
#KT-7773 Fixed
2017-05-26 13:58:46 +03:00
Dmitry Petrov ee9a174c1f KT-7897 Do not require to call enum constructor for each entry if all parameters have default values
Do not report an error on enum entry without initializer if all parameters have default values
(error is still reported if there is no such constructor, or if the constructor call is ambiguous).

Record resolved call on KtEnumEntry.

NB is the enum entry has a corresponding subclass, we still have to generate the "default" constructor call,
because FE doesn't know about the platform-specific representation of that class and its constructors.

See also KT-14097, KT-15900
2017-01-24 16:59:47 +03:00
Mikhail Zarechenskiy 76b0b785c5 Prohibit to use enum entry as a type
#KT-14179 Fixed
2017-01-09 18:30:32 +03:00
Mikhail Glukhikh 194ff4ee76 Check possible smart cast to enum in when subject #KT-14705 Fixed 2016-12-23 15:10:56 +03:00
Mikhail Glukhikh 436b0ec873 CFA merge for definition / initialization : more accurate handling of unknown variables #KT-13969 Fixed
(cherry picked from commit 4a96589)
2016-09-29 15:56:47 +03:00
Mikhail Glukhikh 1a8181bdc4 Only private constructors for sealed / enum classes #KT-12377 Fixed
Also #KT-8497 Fixed
2016-05-23 13:08:57 +03:00
Denis Zharkov d0acb3674a Fix rendered testData
New members in enum member scope
2016-05-16 15:38:13 +03:00
Alexander Udalov 1b8f934b54 Delete deprecated enum 'values' property 2016-02-19 22:28:44 +03:00
Mikhail Glukhikh b93894953d Exhaustive whens without else and 'Nothing' as the result are considered 'implicit exhaustive' 2015-12-26 10:46:11 +03:00
Mikhail Glukhikh c8b50eec1e Enum.values: deprecation (warning) --> deprecation (error) 2015-12-11 11:11:42 +03:00
Mikhail Glukhikh b9e9c47b28 Using of enum entries as types is now forbidden #KT-5401 Fixed 2015-11-25 13:33:16 +03:00
Mikhail Glukhikh dc60c62781 Enum.values is now deprecated but Enum.values() is no more deprecated 2015-11-23 17:29:36 +03:00
Mikhail Glukhikh 74976911a2 Diagnostic for "private setter in abstract property" renamed 2015-11-23 17:29:20 +03:00
Alexey Tsvetkov dc27363452 Remove @annotation from test data 2015-10-19 20:45:01 +03:00
Denis Zharkov 1c02231cda Regenerate rendered descriptors after transforming Enum.values to property 2015-10-17 17:46:16 +03:00
Denis Zharkov d8ede6d03e Transform Enum.values to property 2015-10-17 17:46:16 +03:00