Igor Chevdar
448376f073
[K/N][IR][optmz] Global analysis for top-level initializers
...
The analysis' goal is to remove redundant calls to initializers
2021-07-31 01:40:00 +05:00
Igor Chevdar
9c6943b8c4
[K/N][IR] Split Devirtualization onto phases
...
The analysis itself and applying its results to the IR
2021-07-31 01:40:00 +05:00
Igor Chevdar
b11201be81
[K/N][IR][runtime] Implemented lazy per-file initialization strategy
2021-07-31 01:39:59 +05: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
Mark Punzalan
0627dbcb78
FIR IDE: Check stability of smartcast expressions in
...
KtFirExpressionTypeProvider.getDefiniteNullability().
2021-07-30 21:49:49 +03:00
Mikhail Glukhikh
5283f7b7c6
Make EXPERIMENTAL_API_USAGE_ERR warning till 1.6 for fake override case
2021-07-30 21:21:51 +03:00
Alexander Udalov
3636118743
Introduce typealias JvmRepeatable for j.l.a.Repeatable
...
#KT-12794 Fixed
2021-07-30 19:53:44 +02: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
5f7803f2db
Use double-checked locking in some reflection internals
...
Note that `volatile` is not needed because in both cases we initialize
an object with a final field, which is subject to safe initialization.
2021-07-30 19:53:33 +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
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
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
Ilya Kirillov
e4992176c1
FIR LC: fix inheritance checking for light classes
...
Before it was not able to check inheritance with type parameters substitutions like
class A<T>
class B: A<Int>
2021-07-30 18:59:21 +03:00
Ilya Kirillov
767af0dae0
HL API: fix super declarations search for local classes
2021-07-30 18:59:19 +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
Nikolay Krasko
ca4410aa53
Stop auto-generating expected test data on TeamCity in assertEqualsToFile
2021-07-30 17:46:45 +03:00
Sergey Igushkin
edaf925b19
Reorder Gradle -Xplugin=... so that serialization goes first (KT-47921)
...
Ensure that the serialization plugin's artifact (and, possibly, some
other prioritized plugin artifacts) are put first to the -Xplugin=...
classpath passed to the compiler.
This fixes the conflict of the serialization plugin with some other
plugins altering the IR in unexpected ways.
Issue #KT-47921
2021-07-30 16:20:14 +04:00
Dmitriy Dolovov
033a9f1589
Bump konanVersion: 1.6.0
2021-07-30 14:52:08 +03:00
Ilya Matveev
e45b13d582
[K/N][New MM] Check if asserts are enabled in thread state asserts
2021-07-30 10:30:50 +00:00
Aleksandr Samofalov
5ee87e126d
KMA-51 Use local ObjCExportMapper in ObjCExportTranslatorMobile
2021-07-30 13:13:26 +03:00
Aleksandr Samofalov
d72a399982
KMA-51 Create API to use ObjCExportTranslator to translate functions in IDE
2021-07-30 13:13:26 +03:00
Yahor Berdnikau
90d15f156b
Fix toolchain may fail to find tools.jar and false-fail the build.
...
This may happen when build itself is running on JDK9+ and toolchain
is set to <=JDK1.8. CompilerEnvironment gets 'tools.jar' from the
current Gradle Daemon JDK, but there was a check if exception should be
thrown that uses 'javaVersion' from toolchain provided JDK.
Additionally also fixed 'tools.jar' was not provided for
'KotlinCompileWithWorkers' task.
^KT-47940 Fixed
2021-07-30 09:59:49 +00:00
Yahor Berdnikau
bab5a4a6c9
Allow to specify JDK for build.
...
For now it disables debug option.
^KT-47940 In progress
2021-07-30 09:59:49 +00:00
Alexander Gorshenev
9148094bbd
Garbage collection capable wrappers for skia interop
2021-07-30 12:54:51 +03:00
Alexander Shabalin
d9483ccb08
Enable stacktraces for RuntimeAssert, TODO
2021-07-30 08:22:32 +00:00
Pavel Kunyavskiy
d18ade088d
[K/N] Help message for disabling quarantine flag on dylibs in distribution
2021-07-30 08:17:45 +00:00
Elena Lepilkina
9142b03df5
[K/N][Samples] Use unsigned types in videoplayer
2021-07-30 08:05:44 +00:00