There is some behavior change regarding the new WrapWithSafeLetCall quickfix
1. it now works correctly on binary expressions by wrapping it with `()`
2. it now looks for a nullable position upward and do the modification there,
if possible. For example, consider the following code
```
fun bar(s: String): String = s
fun test(s: String?) {
bar(bar(bar(<caret>s)))
}
```
After applying this fix, FE1.0 yields
```
bar(bar(s?.let { bar(it) }))
```
while the new implementation yields
```
s?.let { bar(bar(bar(it))) }
```
This behavior aligns with FE1.0 if `bar` accepts nullable values.
Previsously, errors have been ignored because we ignored errors raised
from the completion phase
See the comment above the createConstraintPartForLowerBoundAndFlexibleTypeVariable
Remove any logic related to finding the single parameter of the primary
constructor, and use inlineClassRepresentaton from IrClass or
ClassDescriptor instead.
The change in FirDeclarationUtil is needed because in case of unsigned
types loaded from the standard library, the primary constructor for some
reason is not the first, but the second in the list of constructors.
This will be used at least in the JVM backend instead of the current
approach where we're loading the primary constructor's first parameter,
which isn't good enough since primary constructor can be private, and
we can't rely on private declarations in case they're declared in
another module.
In FE10-binding I would like to re-use equal and hashCode mechanics
that was implemented in AbstractTypeConstructor, but I don't need
the supertype implementation, because it already there in FIR
This commit adds the following actions:
- quickfix to implement missing members
- quickfix to implement missing members as constructor parameters
- action to implement members (Code - Generate - Implement)
- action to override members (Code - Generate - Override)
The current implementation is still missing some pieces, which will be
addressed in future changes.
- fully qualified names are not shorten
- some Kotlin types are not rendered correctly
Add extension point for java descriptors
Add simple usage of this point to generate getter method
Add simple test infrastructure to test compilation with lombok plugin
This method can be useful when overriding a throwing Kotlin method in
Swift or Obj-C. In this case, a user can call asError to wrap Kotlin exception
to (NS)Error and then throw it to Kotlin, which will unwrap it back.
^KT-45127 Fixed
KotlinJvmBinaryClass.AnnotationArrayArgumentVisitor didn't cover the
case when the element type is an Annotation. Therefore, when the
compiler read an array of annotations from JVM binary classes built from
Kotlin sources, it got an empty array regardless of what was written in
the bytecode.
For example, Foo.value below is read as an empty array when SomeClass
resides in another Kotlin module.
@Foo(
value = [Bar(1), Bar(2)]
)
class SomeClass