Commit Graph

3935 Commits

Author SHA1 Message Date
Mikhail Glukhikh 15c3269e38 FIR: don't report error on inline nested classes 2021-03-06 09:22:35 +03:00
eugenpolytechnic f6e564ffa6 FIR: introduce inline classes checks 2021-03-06 09:22:34 +03:00
Ilya Gorbunov 9cc8f44390 Support mod and floorDiv extensions in constant evaluator
Ignore evaluation tests for floorDiv and mod with FIR for now.
2021-03-05 23:46:57 +03:00
Mikhael Bogdanov 8ff0b1e243 Reports warning on super calls in public-api inline functions 2021-03-05 18:45:07 +00:00
Jinseong Jeon 1090eca086 RAW FIR: record property accessors' own modality properly 2021-03-04 17:56:30 +03:00
Jinseong Jeon e009b71f88 FIR checker: report uninitialized member/extension properties 2021-03-04 17:56:29 +03:00
Jinseong Jeon e8028e7825 FIR checker: report nullable/non-class LHS of class literals 2021-03-04 17:09:52 +03:00
Mikhail Glukhikh 6470b713d5 FIR: set isConst on primary constructor properties 2021-03-04 16:13:50 +03:00
Mikhail Glukhikh d7a6fc80b0 FIR: don't report CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT on variables 2021-03-04 16:13:50 +03:00
Br0mm dd3bc1a964 FIR: Introduce CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT diagnostic 2021-03-04 16:13:50 +03:00
Tianyu Geng 89ce629352 FIR: report VARARG_OUTSIDE_PARENTHESES 2021-03-03 20:23:59 +03:00
Jinseong Jeon f1fa290d49 FIR checker: report val reassignment 2021-03-03 12:27:11 +03:00
Dmitriy Novozhilov b31b293eef [FIR] Update testdata according to KT-45223 2021-03-02 19:11:17 +03:00
Mikhail Glukhikh 6fee46316e FIR: fix MANY_COMPANION_OBJECTS positioning 2021-03-01 16:57:55 +03:00
Tianyu Geng 724ca1d3ee FIR: introduce diagnostic NESTED_CLASS_NOT_ALLOWED 2021-03-01 16:57:54 +03:00
Jinseong Jeon c5cabce2d5 FIR: check visibility properly for CANNOT_CHANGE_ACCESS_PRIVILEGE 2021-03-01 16:57:51 +03:00
Ilmir Usmanov 62123d72e2 IC: Add inline class -> @JvmInline value class warning 2021-02-25 16:06:47 +01:00
Mark Punzalan 1c94372b6c FIR checker/IDE: Add checker and quickfix for VAL_WITH_SETTER. 2021-02-25 13:06:53 +01:00
Dmitriy Novozhilov 4222bb9af2 [FE] Make whens on expect sealed classes and enums not exhaustive 2021-02-25 14:56:08 +03:00
Tianyu Geng 5bdea9652b FIR: fix position and reporting of PRIVATE_SETTER_*
Previously `FirPropertyAccessor.source` references the `KtProperty` if
the user code contains a setter or getter that doesn't contain a body.
For example, with the following

```
val i: Int = 1
  private set
```

The `FirPropertyAccessor` would reference the `KtProperty` as the
source.

This change makes `FirPropertyAccessor` reference `KtPropertyAccessor`
as the source if possible, regardless of whether the body is present or
not.
2021-02-24 13:50:46 +03:00
Tianyu Geng bdeecfc188 FIR: check multiple vararg param and forbidden vararg type 2021-02-24 13:50:46 +03:00
Victor Petukhov 4e5647090e Approximate captured types in contravariant positions properly
^KT-43802 Fixed
2021-02-20 16:57:07 +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
Dmitriy Novozhilov 1c0d862e40 [FIR] Don't smartcast variables to invisible types
#KT-44802 Fixed
2021-02-20 10:23:33 +03:00
Mikhail Glukhikh 7c080395f2 FIR: minor test data fixes 2021-02-19 18:24:49 +03:00
Mikhail Glukhikh 239a44b30c FIR: forbid reporting inapplicable-likes on implicit constructors 2021-02-19 18:24:46 +03:00
Mikhail Glukhikh 34c90aab3b FIR: introduce & use REFERENCE_BY_QUALIFIER positioning strategy 2021-02-19 18:24:46 +03:00
Mikhail Glukhikh 5892646a27 Change FirQualifiedAccess source to KtQualifiedExpression (if any) 2021-02-19 18:24:45 +03:00
Dmitriy Novozhilov 88c43e7f7b [FE] Assume that effective visibility of sealed class constructor is internal
#KT-45033 Fixed
#KT-45043
2021-02-19 14:06:49 +03:00
Mikhail Glukhikh 357a7907a3 FIR: fix type approximation by visibility 2021-02-19 10:39:57 +03:00
Tianyu Geng 6b453d9b23 FIR: implement checker for open members
Specifically,

1. NON_FINAL_MEMBER_IN_FINAL_CLASS
2. NON_FINAL_MEMBER_IN_OBJECT
2021-02-19 10:17:18 +03:00
Mikhail Glukhikh 3e9ff3ecda FIR: report SUPERTYPE_NOT_A_CLASS_OR_INTERFACE on type parameters 2021-02-19 10:17:17 +03:00
Jinseong Jeon 27c942a0ff FIR: enforce the return type of function literals without body
Its return type should be Unit, so do not use the expected type from,
e.g., parameter type.
2021-02-19 10:17:16 +03:00
Dmitriy Novozhilov df42868874 [Inference] Fix subtyping on classes with same FQN but with different number of arguments
Such situations may appear if there are multiple classes with same
  names from different modules in dependencies
2021-02-17 16:23:08 +03:00
Dmitriy Novozhilov 373bc578fb [FIR] Implement capturing of cone types same as for kotlin types 2021-02-17 16:23:08 +03:00
Dmitriy Novozhilov 5ce36a528e [FE] Prohibit sealed fun interfaces
#KT-44947 Fixed
2021-02-17 13:54:10 +03:00
Dmitriy Novozhilov cdf7de5524 [FE] Change message for sealed interfaces with language target < 1.5 2021-02-17 13:51:14 +03:00
pyos 2dc0404751 FIR: prioritize visible imported classes during type resolution
and produce an error on ambiguity.
2021-02-16 12:38:45 +03:00
Mark Punzalan 2f450549ab FIR IDE: Update FIR diagnostic test data for
INAPPLICABLE_LATEINIT_MODIFIER.
2021-02-15 19:37:14 +01:00
Alexander Udalov 899f75466d Remove tests on kotlin-annotations-android
#KT-44815
2021-02-15 17:23:44 +01:00
Jinseong Jeon a884555171 FIR: bail out early for override check if base candidate is private 2021-02-15 19:16:36 +03:00
Jinseong Jeon 09640d9d63 FIR checker: apply override checker to anonymous objects
^KT-44695 Fixed
2021-02-15 19:16:35 +03:00
Jinseong Jeon 9370f918e9 FIR: use override checker when populating directOverriddenProperties 2021-02-15 19:16:35 +03:00
Victor Petukhov fa1507fb91 Fix FIR test lambdaParameterTypeInElvis 2021-02-15 18:51:51 +03:00
Victor Petukhov dcad9c84fc Don't fix type variables into Nothing in priority way
^KT-44546 Fixed
2021-02-15 15:12:45 +03:00
Victor Petukhov c0759f96e9 Fix FIR test lambdaParameterTypeInElvis 2021-02-15 12:59:07 +03:00
Victor Petukhov 0d40022d6d Add reporting of the warnings based on Java annotations for expanded type aliases
Before that, such warnings weren't reported as the corresponding errors were reported during type inference (only original types took part there)
2021-02-15 12:13:55 +03:00
Dmitriy Novozhilov 5711a8d610 [FIR] Support PreliminaryLoopVisitor in FIR DFA 2021-02-15 11:37:39 +03:00
Victor Petukhov 6f64fd2fec Propagate inference session into declaration analyzers
It prevents missing inference session for local declaration (local functions, local classes or objects)

^KT-44801 Fixed
2021-02-15 11:12:58 +03:00
Dmitriy Novozhilov 2d5b685535 [FIR] Fix processing constructors of sealed classes
- Allow declaring protected constructors in sealed classes
- Make default visibility of sealed class constructor `protected`

KT-44861
KT-44865
2021-02-12 13:36:41 +03:00