Dmitriy Novozhilov
b584fed93d
[FIR] Migrate warning/error pairs to DiagnosticFactoryForDeprecation
2021-08-03 00:20:11 +03:00
Dmitriy Novozhilov
adfeab1bd0
[FIR] Add ability to generate special diagnostic factories for deprecation warnings
...
This kind of diagnostic factory has two different factories with warning
and error severity and language feature with turns on reporting of error
2021-08-03 00:17:33 +03:00
Igor Yakovlev
bbd21da835
[FIR] Move ARGUMENTS_OF_ANNOTATIONS on top of STATUS phase
2021-08-02 20:29:09 +03:00
Igor Yakovlev
0f3f56f676
[FIR] Update resolve status of annotations to partially resolved
2021-08-02 20:29:08 +03:00
Igor Yakovlev
8fd2ddad12
[FIR] Downgrade ensure resolves to types instead of status
2021-08-02 20:29:07 +03:00
Igor Yakovlev
c0949fbc18
[FIR] Remove redundant ensure to status in FirPackageMemberScope
2021-08-02 20:29:06 +03:00
Igor Yakovlev
9fdd3dc53f
[FIR IDE] Add support of lazy phase for annotation arguments
2021-08-02 20:29:06 +03:00
Dmitriy Novozhilov
71def0666e
[FIR] Introduce special phase for resolve of enums and class literals
2021-08-02 20:29:05 +03:00
Ivan Kochurkin
afb85026c4
Revert "[FIR] Implement INVISIBLE_SETTER"
...
This reverts commit b3d7ed56
2021-08-02 20:10:22 +03:00
Ivan Kochurkin
b264a2e5dd
[FIR] Fix Consider getter and setter for CANNOT_WEAKEN_ACCESS_PRIVILEGE
...
Hash: 0e2d765a2d
2021-08-02 20:10:22 +03:00
Simon Ogorodnik
ed07e1c778
[FIR] Add missing type-alias unwrap in CompletionModeCalculator
2021-08-02 17:07:15 +03:00
Simon Ogorodnik
8e890eba3e
[FIR] Hack-in indirectly nested locals resolution
2021-08-02 17:07:15 +03:00
Simon Ogorodnik
7422571c72
[FIR] Fix cycle when loading nested enum within java annotation
2021-08-02 17:07:15 +03:00
Simon Ogorodnik
a353719a6b
[FIR] Add dump for fir blocks
2021-08-02 11:24:56 +03:00
Dmitriy Novozhilov
199ec60742
[JVM] Reduce number of param slots for string concatenation
...
With paramSlot = 200 those tests fails on JDKs which are newer than JDK 9
- testConcatDynamic200Long
- testConcatDynamicIndy200Long()
2021-08-01 22:23:48 +03:00
Dmitriy Novozhilov
fa1d09c778
[FE 1.0] Support java sealed classes
...
^KT-46778 Fixed
2021-08-01 22:23:45 +03:00
Dmitriy Novozhilov
1fa74ef939
[Test] Move test on modern jdk to separate test runners
...
This is needed to avoid problems with installation of proper jdk
on developer machines. Those tests will be moved back to main box
suites after migrating our tests on LTS versions of jdk (11 and 17
instead of 9 and 15)
2021-08-01 22:23:43 +03:00
Dmitriy Novozhilov
de73622af9
[Test] Mark BB tests on modern jdks with tag and ignore them in different-jdk tests
2021-08-01 22:23:42 +03:00
Dmitriy Novozhilov
c168a561df
[Test] Migrate tests for java 15 to regular test infrastructure
2021-08-01 22:23:39 +03:00
Dmitriy Novozhilov
4f73ebbcbd
[Test] Migrate tests for java 9 to regular test infrastructure
2021-08-01 22:23:39 +03:00
Mark Punzalan
504449f03e
FIR: Report UNSAFE_CALL instead of SMARTCAST_IMPOSSIBLE when smartcast
...
to null.
Currently the error message shows the expression is impossible to
smartcast to the nullable type, which is nonsensical since it's already
that type.
2021-07-30 21:49:50 +03:00
Alexander Udalov
847c58d574
Report error on class named Container inside repeatable annotation
...
#KT-12794
#KT-47971
2021-07-30 19:53:44 +02:00
Alexander Udalov
e20b354dbd
Check repeatable annotation container parameters, retention, target
...
#KT-12794
#KT-47928
2021-07-30 19:53:33 +02:00
Alexander Udalov
0a6d010d1c
Support new repeatable annotations in kotlin-reflect
...
- Unwrap Kotlin-repeatable annotations (with implicit container)
- Introduce `KAnnotatedElement.findAnnotations` to find instances of
repeated annotations
#KT-12794
2021-07-30 19:53:33 +02:00
Alexander Udalov
67128c022a
Report error if both repeatable annotation and its container are used
...
#KT-12794
2021-07-30 19:53:32 +02:00
Alexander Udalov
b2550f69bc
Report error if repeated annotation is used with JVM target 1.6
...
#KT-12794
2021-07-30 19:53:32 +02:00
Alexander Udalov
26043f3968
Generate Java @Repeatable on Kotlin-repeatable annotation classes
...
#KT-12794
2021-07-30 19:53:32 +02:00
Alexander Udalov
92a73d7636
Generate container class for repeatable annotations
...
#KT-12794
2021-07-30 19:53:32 +02:00
Alexander Udalov
87130edfa2
Support using Java-repeatable annotations in Kotlin
...
#KT-12794
2021-07-30 19:53:32 +02:00
Alexander Udalov
f723389565
Remove mapping of java.Repeatable to kotlin.Repeatable in JavaAnnotationMapper
...
The main motivation for this change is that
java.lang.annotation.Repeatable has a parameter for the container
annotation, which is lost during conversion to
kotlin.annotation.Repeatable. To support j.l.a.Repeatable in backend
properly, it's absolutely necessary to be able to load the container
annotation for any repeatable annotation class, so the original
j.l.a.Repeatable needs to be stored in the descriptor and accessible
from the backend.
Instead of mapping j.l.a.Repeatable -> k.a.Repeatable, add a frontend
service PlatformAnnotationFeaturesSupport that will determine if an
annotation is repeatable "according to the platform rules", which for
JVM means that it's annotated with j.l.a.Repeatable.
Some effects of this change include:
- Usages of j.l.a.Repeatable are no longer reported as "deprecated", the
corresponding test is deleted
- Usages of repeatable annotations declared in Java with non-SOURCE
retention with LV 1.5 and earlier will now result in a slightly
different error (REPEATED_ANNOTATION instead of
NON_SOURCE_REPEATED_ANNOTATION)
#KT-12794
2021-07-30 19:53:32 +02:00
Ivan Kochurkin
1a40164ef0
[FIR] Fix resolving of single underscore _
...
Now compiler throws `UNRESOLVED_REFERENCE` here:
```
val boo = { _: Exception -> `_`.stackTrace }
```
2021-07-30 16:58:07 +00:00
Ivan Kochurkin
8bfaa39a5c
[FIR] Implement RESOLVED_TO_UNDERSCORE_NAMED_CATCH_PARAMETER
...
Split underscore checkers
2021-07-30 16:58:07 +00:00
Ivan Kochurkin
10d9988824
[FIR] Implement DANGEROUS_CHARACTERS
2021-07-30 16:58:06 +00:00
Ivan Kochurkin
83895c49c5
[FIR] Implement INVALID_CHARACTERS
2021-07-30 16:58:06 +00:00
Ivan Kochurkin
63fc3645ab
[FIR] Optimize performance and fix UNDERSCORE_IS_RESERVED, simplify code
2021-07-30 16:58:05 +00:00
Ivan Kochurkin
2fbb700ec6
[FIR] Add nonFatalDiagnostics to FirQualifierAccess
2021-07-30 16:58:05 +00:00
Ivan Kochurkin
b307358f69
[FIR] buildErrorExpression for labels with underscored name
...
Add ConeDiagnosticWithSource, ConeUnderscoreIsReserved, ConeUnderscoreUsageWithoutBackticks diagnostics
2021-07-30 16:58:05 +00:00
Ivan Kochurkin
f5d8535dc5
[FIR] Add aliasSource to FirImport, FirImportImpl
2021-07-30 16:58:04 +00:00
Mikhail Glukhikh
354a06b94a
FirSuspendCallChecker: make infix call check more clear
2021-07-30 19:06:55 +03:00
Mikhail Glukhikh
3c2e266c31
FirSuspendCallChecker: use symbol accessor API instead of symbol.fir
2021-07-30 19:06:54 +03:00
Mikhail Glukhikh
e0b1d0db53
FirSuspendCallChecker: drop support of experimental coroutines
2021-07-30 19:06:53 +03:00
Mikhail Glukhikh
807f031dcc
FIR: introduce RETURN_FOR_BUILT_IN_SUSPEND diagnostic
2021-07-30 19:06:53 +03:00
Mikhail Glukhikh
229dfd3f5f
FIR: introduce builtin suspend related diagnostics
2021-07-30 19:06:51 +03:00
Mikhail Glukhikh
391c4db87c
FIR: introduce ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL diagnostics
2021-07-30 19:06:49 +03:00
Mikhail Glukhikh
2397650c24
FIR: introduce NON_LOCAL_SUSPENSION_POINT diagnostic
2021-07-30 19:06:48 +03:00
Mikhail Glukhikh
8f1d07084b
FIR: introduce ILLEGAL_SUSPEND_FUNCTION_CALL & PROPERTY_ACCESS diagnostics
2021-07-30 19:06:46 +03:00
Ivan Kochurkin
0e2d765a2d
[FIR] Consider getter and setter for CANNOT_WEAKEN_ACCESS_PRIVILEGE
...
Fill source with correct value instead of null
for FirDefaultPropertySetter in light tree converter
2021-07-30 18:07:35 +03:00
Ivan Kochurkin
b3d7ed569d
[FIR] Implement INVISIBLE_SETTER
2021-07-30 18:07:34 +03:00
Dmitry Petrov
ca5ebdc13c
PSI2IR KT-44855 propagate smart cast information for property values
2021-07-29 21:41:50 +03:00
Mikhail Glukhikh
55f7bb2756
Fix FIR PSI consistency test (definitely not-null types)
2021-07-29 19:45:57 +02:00