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
Dmitry Petrov
ebf837c135
JVM_IR disable IR and bytecode validation by default
2021-07-30 20:21:41 +03: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
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
Mikhael Bogdanov
cdbd0eb932
Reopen KT-47920 test and add missed .txt files
...
#KT-47920 Open
2021-07-29 19:52:59 +02:00
Mikhael Bogdanov
824d6ab5cc
Update tests affected by 'ProhibitSimplificationOfNonTrivialConstBooleanExpressions' feature
2021-07-29 19:45:57 +02:00
Alexander Udalov
d36c56497e
Minor, improve CLI test internalArgOverrideOffLanguageFeature
...
Avoid disabling language features which cannot be disabled anymore.
2021-07-29 19:45:57 +02:00
Denis.Zharkov
ee68962c02
Ignore Jvm8RuntimeDescriptorLoaderTestGenerated::testMapRemove
...
For now, JavaResolverSettings in runtime are different from
default language version, so it might have a little bit different API surface
In future, it's worth considering changing JavaResolverSettings.Default
once default language version is changing
#KT-47903
2021-07-29 19:45:57 +02:00
Mikhael Bogdanov
4fe846fb81
Fix test affected by InstantiationOfAnnotationClasses feature
2021-07-29 19:45:57 +02:00
Mikhael Bogdanov
1347ee8c7d
Update DiagnosicTestGenerated affected by 'PrivateInFileEffectiveVisibility' feature
2021-07-29 19:45:57 +02:00
Denis.Zharkov
d2ad421e0b
Fix test data for definitelyNotNullType
2021-07-29 19:45:57 +02:00
Denis.Zharkov
8f484fcf88
Fix propagation of definitelyNotNull types from overrides
2021-07-29 19:45:57 +02:00
Mikhael Bogdanov
baaa615e09
Update FirOldFrontendDiagnosticsTestGenerated tests
2021-07-29 19:45:56 +02:00
Mikhael Bogdanov
70e4472c99
Update Fir2IrTextTestGenerated tests
2021-07-29 19:45:56 +02:00
Victor Petukhov
d2a7434cff
Update testdata
2021-07-29 19:45:56 +02:00
Denis.Zharkov
f34726ff91
Fix test data for ForeignAnnotations
2021-07-29 19:45:56 +02:00
Dmitriy Novozhilov
2ae546576c
[FE 1.0] Update DUPLICATE_LABEL_IN_WHEN testdata
...
New diagnostics started to report because in 1.6 we assume that
`1` is typed const of type Int instead of literal const
2021-07-29 19:45:56 +02:00
Dmitriy Novozhilov
e316cd04b6
[FIR] Fix consistency of FE 1.0 and FIR test data
2021-07-29 19:45:56 +02:00
Denis.Zharkov
699d53e7f9
Fix ISE when copying a function with @NotNull bounded type parameters
...
For example in the case:
<_A extends @NotNull B, B> void f4(_A x, B y) { }
ISE had happened because while substituting the function
we've been creating copies of old type parameters and when initializing
bounds for one of them bounds for other may not be initialized yet
at the same time bounds were necessary for makesSenseToBeDefinitelyNotNull
2021-07-29 19:45:56 +02:00
Mikhael Bogdanov
0c419eac1a
Update Java8BuiltInsWithJDKMembersTest tests
2021-07-29 19:45:56 +02:00
Mikhael Bogdanov
0f216f4d37
Update LoadJava8TestGenerated tests
2021-07-29 19:45:56 +02:00
Mikhael Bogdanov
a544d6948b
Fix simpleUnaryOperators.kt test
2021-07-29 19:45:56 +02:00
Victor Petukhov
f84adcb378
[FE 1.0] Fix some foreign annotation tests
2021-07-29 19:45:56 +02:00
Alexander Udalov
0ed9b75428
Minor, fix diagnostic test data for FIR
2021-07-29 19:45:55 +02:00
Alexander Udalov
b442e598d3
Fix test data of codegen tests for KT-47328 for 1.6
2021-07-29 19:45:55 +02:00
Alexander Udalov
f1ac5796ed
Fix test data of compileJavaAgainstKotlin for 1.6
...
See LanguageFeature.DefinitelyNotNullTypeParameters.
2021-07-29 19:45:55 +02:00
Alexander Udalov
2d0d83a54b
Fix AntTaskTestGenerated.testLanguageVersion for 1.6
2021-07-29 19:45:55 +02:00
Victor Petukhov
95492f7370
[FE 1.0] Fix some diagnostic tests
2021-07-29 19:45:55 +02:00
Dmitriy Novozhilov
7250aed3b5
[FE 1.0] Fix some diagnostic tests
2021-07-29 19:45:55 +02:00
Mikhael Bogdanov
c9c82ab3a6
Update test affected by SafeCallsAreAlwaysNullable feature
2021-07-29 19:45:55 +02:00
Mikhael Bogdanov
70fe984738
Update classTypeParameter.kt test
2021-07-29 19:45:55 +02:00
Mikhael Bogdanov
cc5ba4c0af
Update diagnostic tests
2021-07-29 19:45:54 +02:00
Mikhael Bogdanov
0cccb76652
Update tests affected by ProperTypeInferenceConstraintsProcessing feature
2021-07-29 19:45:54 +02:00