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
Dmitriy Novozhilov
7c61ddc72b
[FE] Allow declaring protected constructors in sealed classes
...
#KT-44865 Fixed
2021-02-12 13:36:39 +03:00
Dmitriy Novozhilov
f3a8fcaea6
[FE] Make constructors of sealed classes protected instead of internal
2021-02-12 13:36:38 +03:00
Jinseong Jeon
9b1f01ab04
FIR checker: differentiate unsafe infix/operator calls from UNSAFE_CALL
2021-02-10 17:38:45 +03:00
Jinseong Jeon
5e150d62ea
FIR checker: differentiate UNSAFE_IMPLICIT_INVOKE_CALL from UNSAFE_CALL
2021-02-10 17:38:44 +03:00
Dmitriy Novozhilov
0c0c53cc2e
[FE] Don't analyze members with CLASSIFIERS kind filter in AbstractLazyMemberScope
...
This commit introduces partial support of descriptorKindFilter in
`AbstractPsiBasedDeclarationProvider`. Without it there may be an error
in following case:
```
sealed class Base
class Derived : Base()
class Test<out V>(val x: Base) {
private val y = when (x) {
is Derived -> null
}
}
```
Here we start to resolve type of `y`, then go to computation of inheritors
of sealed class Base, which also may be inside Test, so we need get all
nested classifiers in Test. But without this filtration we will start
computing descriptor for `y` again, which leads to ReenteringLazyComputationException
#KT-44316 Fixed
2021-02-10 16:56:49 +03:00
Jinseong Jeon
bd37badf29
FIR checker: add diagnostics for backing fields
2021-02-10 12:29:34 +03:00
Dmitriy Novozhilov
18bde2c542
[FIR] Reimplement when exhaustiveness checker to fir it's logic with FE 1.0
2021-02-09 16:04:41 +03:00
Dmitriy Novozhilov
8dd9d98129
[FIR] Implement checker for exhaustive when's in expression position
2021-02-09 16:04:40 +03:00
Dmitriy Novozhilov
490ef210ac
[FIR] Support sealed class inheritors in multiple files
2021-02-09 16:04:39 +03:00
Dmitriy Novozhilov
9724d81a49
[FIR] Support boolean elvis bound smartcasts
...
#KT-44511 Fixed
2021-02-09 15:20:36 +03:00
Mikhail Glukhikh
1c210c2386
FIR: fix of super.methodOfAny resolve in case of one supertype
2021-02-08 14:28:25 +03:00
Jinseong Jeon
266432a482
FIR checker: fix condition for property type mismatch on override
2021-02-08 13:01:11 +03:00
Victor Petukhov
f9e5584a3e
Report error about uninferred type parameter for all CallForImplicitInvoke psi calls
...
^KT-44368 Fixed
2021-02-08 10:40:18 +03:00
eugenpolytechnic
a564f92eef
FIR: introduce ThrowableSubclassChecker
2021-02-05 09:22:12 +03:00
Denis.Zharkov
173a852273
FIR: Fix uninitialized lateinit FirSymbol::symbol for supertype of Java class
...
Earlier, isForSupertypes has been mapped to different boolean parameter
2021-02-03 15:05:21 +03:00
Jinseong Jeon
ca314c5bb9
FIR checker: add diagnostic CANNOT_WEAKEN_ACCESS_PRIVILEGE
2021-02-03 12:07:36 +03:00
Jinseong Jeon
3a07ca4c64
FIR checker: add diagnostic VAR_OVERRIDDEN_BY_VAL
2021-02-03 12:07:36 +03:00
Jinseong Jeon
80d5a1a1db
FIR checker: add diagnostic OVERRIDING_FINAL_MEMBER
2021-02-03 12:07:36 +03:00
Jinseong Jeon
4ef1e1119f
FIR LT: introduce positioning strategies for specific modifiers
2021-02-03 12:07:35 +03:00
Jinseong Jeon
b48835f3ce
FIR checker: fix positions of type mismatch on overrides
...
To handle implicit return types, those should be reported on
declarations with return type positioning strategy, instead of
return type itself.
2021-02-03 12:07:35 +03:00
Nicola Corti
e2b7aba086
Do not report UNNECESSARY_SAFE_CALL on ErrorType
2021-02-02 12:10:56 +03:00
Igor Yakovlev
9f282e0ddc
[FIR] Do not erase type arguments for unresolved method calls
2021-02-01 21:21:02 +03:00
eugenpolytechnic
9ad88a5a0d
FIR: introduce parameter type is Throwable check
2021-02-01 15:07:21 +03:00
eugenpolytechnic
5c0231b727
FIR: introduce CatchParameterChecker
2021-02-01 15:07:13 +03:00
Alexander Udalov
d022bb0248
Switch default JVM target to 1.8
...
#KT-29405 Fixed
2021-02-01 11:54:04 +01:00
Mikhail Glukhikh
7d4eaefd36
FIR: report UNSAFE_CALL on dot when possible
2021-01-29 16:55:26 +03:00
Mikhail Glukhikh
0ee4f1f393
FIR: more exact nullability determination in potential UNSAFE_CALL check
2021-01-29 16:55:09 +03:00
Jinseong Jeon
e72ddbcbfe
FIR checker: differentiate UNSAFE_CALL from INAPPLICABLE_CANDIDATE
...
To do so, inside the root cause of inapplicable candidate errors,
we will record expected/actual type of receiver, if any.
That will help identifying inapplicable calls on nullable receiver.
2021-01-29 16:54:23 +03:00
Mikhail Glukhikh
4b823eca21
Fix test data (FIR_IDENTICAL)
2021-01-29 16:54:17 +03:00
Victor Petukhov
9efac8f68b
Propagate all annotations during creating simple functional types
...
^KT-44563 Fixed
2021-01-29 13:50:46 +03:00
Dmitriy Novozhilov
f3364ec602
[TD] Update testdata according to KT-44546
2021-01-28 13:19:33 +03:00