FIR: disregard enhancements for warnings
Warnings are not implemented yet, so don't produce errors either.
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
|||||||
public open class NonNullNever : R|kotlin/Any| {
|
public open class NonNullNever : R|kotlin/Any| {
|
||||||
@R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.NEVER|()) public open field field: R|kotlin/String?|
|
@R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.NEVER|()) public open field field: R|kotlin/String?|
|
||||||
|
|
||||||
@R|MyNullable|() public open fun foo(@R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.NEVER|()) x: R|kotlin/String?|, @R|MyNullable|() y: R|kotlin/CharSequence?|): R|kotlin/String?|
|
@R|MyNullable|() public open fun foo(@R|javax/annotation/Nonnull|(R|javax/annotation/meta/When.NEVER|()) x: R|kotlin/String?|, @R|MyNullable|() y: R|ft<kotlin/CharSequence, kotlin/CharSequence?>|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public constructor(): R|NonNullNever|
|
public constructor(): R|NonNullNever|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
@R|FieldsAreNullable|() public open class A : R|kotlin/Any| {
|
@R|FieldsAreNullable|() public open class A : R|kotlin/Any| {
|
||||||
public open field field: R|kotlin/String?|
|
public open field field: R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|javax/annotation/Nonnull|() public open field nonNullField: R|@EnhancedNullability kotlin/String|
|
@R|javax/annotation/Nonnull|() public open field nonNullField: R|@EnhancedNullability kotlin/String|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
@R|spr/NonNullApi|() public open class A : R|kotlin/Any| {
|
@R|spr/NonNullApi|() public open class A : R|kotlin/Any| {
|
||||||
public open fun foo(x: R|@EnhancedNullability kotlin/String|, @R|spr/Nullable|() y: R|kotlin/CharSequence?|): R|@EnhancedNullability kotlin/String|
|
public open fun foo(x: R|ft<kotlin/String, kotlin/String?>|, @R|spr/Nullable|() y: R|ft<kotlin/CharSequence, kotlin/CharSequence?>|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|spr/ForceFlexibility|() public open fun bar(x: R|ft<kotlin/String, kotlin/String?>|, @R|javax/annotation/Nonnull|() y: R|@EnhancedNullability kotlin/CharSequence|): R|ft<kotlin/String, kotlin/String?>|
|
@R|spr/ForceFlexibility|() public open fun bar(x: R|ft<kotlin/String, kotlin/String?>|, @R|javax/annotation/Nonnull|() y: R|@EnhancedNullability kotlin/CharSequence|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
|
|||||||
+13
-13
@@ -1,55 +1,55 @@
|
|||||||
@R|NonNullApi|() public open class A : R|kotlin/Any| {
|
@R|NonNullApi|() public open class A : R|kotlin/Any| {
|
||||||
public open fun foo1(x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/String|
|
public open fun foo1(x: R|ft<kotlin/String, kotlin/String?>|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun foo2(x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/String|
|
public open fun foo2(x: R|ft<kotlin/String, kotlin/String?>|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun foo3(x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/String|
|
public open fun foo3(x: R|ft<kotlin/String, kotlin/String?>|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|javax/annotation/Nullable|() public open fun bar1(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/String?|
|
@R|javax/annotation/Nullable|() public open fun bar1(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/String?|
|
||||||
|
|
||||||
@R|javax/annotation/Nullable|() public open fun bar2(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/String?|
|
@R|javax/annotation/Nullable|() public open fun bar2(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/String?|
|
||||||
|
|
||||||
public open fun baz(@R|javax/annotation/Nonnull|() x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/String|
|
public open fun baz(@R|javax/annotation/Nonnull|() x: R|@EnhancedNullability kotlin/String|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public constructor(): R|A|
|
public constructor(): R|A|
|
||||||
|
|
||||||
}
|
}
|
||||||
@R|NonNullApi|() public abstract interface AInt : R|kotlin/Any| {
|
@R|NonNullApi|() public abstract interface AInt : R|kotlin/Any| {
|
||||||
public abstract fun foo1(x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/CharSequence|
|
public abstract fun foo1(x: R|ft<kotlin/String, kotlin/String?>|): R|ft<kotlin/CharSequence, kotlin/CharSequence?>|
|
||||||
|
|
||||||
public abstract fun foo2(x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/CharSequence|
|
public abstract fun foo2(x: R|ft<kotlin/String, kotlin/String?>|): R|ft<kotlin/CharSequence, kotlin/CharSequence?>|
|
||||||
|
|
||||||
public abstract fun foo3(x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/CharSequence|
|
public abstract fun foo3(x: R|ft<kotlin/String, kotlin/String?>|): R|ft<kotlin/CharSequence, kotlin/CharSequence?>|
|
||||||
|
|
||||||
@R|javax/annotation/Nullable|() public abstract fun bar1(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/CharSequence?|
|
@R|javax/annotation/Nullable|() public abstract fun bar1(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/CharSequence?|
|
||||||
|
|
||||||
@R|javax/annotation/Nullable|() public abstract fun bar2(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/CharSequence?|
|
@R|javax/annotation/Nullable|() public abstract fun bar2(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/CharSequence?|
|
||||||
|
|
||||||
public abstract fun baz(@R|javax/annotation/Nonnull|() x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/CharSequence|
|
public abstract fun baz(@R|javax/annotation/Nonnull|() x: R|@EnhancedNullability kotlin/String|): R|ft<kotlin/CharSequence, kotlin/CharSequence?>|
|
||||||
|
|
||||||
}
|
}
|
||||||
@R|NullableApi|() public open class B : R|A|, R|AInt| {
|
@R|NullableApi|() public open class B : R|A|, R|AInt| {
|
||||||
public open fun foo1(x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/String|
|
public open fun foo1(x: R|ft<kotlin/String, kotlin/String?>|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|javax/annotation/Nonnull|() public open fun foo2(@R|javax/annotation/Nonnull|() x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/String|
|
@R|javax/annotation/Nonnull|() public open fun foo2(@R|javax/annotation/Nonnull|() x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/String|
|
||||||
|
|
||||||
public open fun bar1(x: R|kotlin/String?|): R|kotlin/String?|
|
public open fun bar1(x: R|kotlin/String?|): R|kotlin/String?|
|
||||||
|
|
||||||
public open fun baz(x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/String|
|
public open fun baz(x: R|@EnhancedNullability kotlin/String|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public constructor(): R|B|
|
public constructor(): R|B|
|
||||||
|
|
||||||
}
|
}
|
||||||
@R|NonNullApi|() public open class C : R|A|, R|AInt| {
|
@R|NonNullApi|() public open class C : R|A|, R|AInt| {
|
||||||
public open fun foo1(x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/String|
|
public open fun foo1(x: R|ft<kotlin/String, kotlin/String?>|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun foo2(@R|javax/annotation/Nonnull|() x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/String|
|
public open fun foo2(@R|javax/annotation/Nonnull|() x: R|@EnhancedNullability kotlin/String|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun bar1(x: R|kotlin/String?|): R|kotlin/String?|
|
public open fun bar1(x: R|kotlin/String?|): R|kotlin/String?|
|
||||||
|
|
||||||
@R|javax/annotation/Nullable|() public open fun bar2(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/String?|
|
@R|javax/annotation/Nullable|() public open fun bar2(@R|javax/annotation/Nullable|() x: R|kotlin/String?|): R|kotlin/String?|
|
||||||
|
|
||||||
public open fun baz(x: R|@EnhancedNullability kotlin/String|): R|@EnhancedNullability kotlin/String|
|
public open fun baz(x: R|@EnhancedNullability kotlin/String|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public constructor(): R|C|
|
public constructor(): R|C|
|
||||||
|
|
||||||
|
|||||||
+12
-12
@@ -1,24 +1,24 @@
|
|||||||
@R|NonNullApi|() public open class A : R|kotlin/Any| {
|
@R|NonNullApi|() public open class A : R|kotlin/Any| {
|
||||||
public open field field: R|@EnhancedNullability kotlin/String|
|
public open field field: R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun foo(x: R|@EnhancedNullability kotlin/String|, @R|javax/annotation/CheckForNull|() y: R|kotlin/CharSequence?|): R|@EnhancedNullability kotlin/String|
|
public open fun foo(x: R|ft<kotlin/String, kotlin/String?>|, @R|javax/annotation/CheckForNull|() y: R|kotlin/CharSequence?|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|NullableApi|() public open fun foobar(x: R|kotlin/String?|, @R|NonNullApi|() y: R|@EnhancedNullability kotlin/CharSequence|): R|kotlin/String?|
|
@R|NullableApi|() public open fun foobar(x: R|ft<kotlin/String, kotlin/String?>|, @R|NonNullApi|() y: R|ft<kotlin/CharSequence, kotlin/CharSequence?>|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun bar(): R|@EnhancedNullability kotlin/String|
|
public open fun bar(): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|javax/annotation/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>>?>|
|
@R|javax/annotation/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>>?>|
|
||||||
|
|
||||||
public constructor(): R|A|
|
public constructor(): R|A|
|
||||||
|
|
||||||
@R|NullableApi|() public open inner class B : R|kotlin/Any| {
|
@R|NullableApi|() public open inner class B : R|kotlin/Any| {
|
||||||
public open field field: R|kotlin/String?|
|
public open field field: R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun foo(x: R|kotlin/String?|, @R|javax/annotation/Nonnull|() y: R|@EnhancedNullability kotlin/CharSequence|): R|kotlin/String?|
|
public open fun foo(x: R|ft<kotlin/String, kotlin/String?>|, @R|javax/annotation/Nonnull|() y: R|@EnhancedNullability kotlin/CharSequence|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|NonNullApi|() public open fun foobar(x: R|@EnhancedNullability kotlin/String|, @R|NullableApi|() y: R|kotlin/CharSequence?|): R|@EnhancedNullability kotlin/String|
|
@R|NonNullApi|() public open fun foobar(x: R|ft<kotlin/String, kotlin/String?>|, @R|NullableApi|() y: R|ft<kotlin/CharSequence, kotlin/CharSequence?>|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun bar(): R|kotlin/String?|
|
public open fun bar(): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|javax/annotation/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>>?>|
|
@R|javax/annotation/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>>?>|
|
||||||
|
|
||||||
@@ -26,13 +26,13 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
@R|FieldsAreNullable|() public open inner class C : R|kotlin/Any| {
|
@R|FieldsAreNullable|() public open inner class C : R|kotlin/Any| {
|
||||||
public open field field: R|kotlin/String?|
|
public open field field: R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun foo(x: R|@EnhancedNullability kotlin/String|, @R|javax/annotation/Nullable|() y: R|kotlin/CharSequence?|): R|@EnhancedNullability kotlin/String|
|
public open fun foo(x: R|ft<kotlin/String, kotlin/String?>|, @R|javax/annotation/Nullable|() y: R|kotlin/CharSequence?|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|NullableApi|() public open fun foobar(x: R|kotlin/String?|, @R|javax/annotation/Nullable|() y: R|kotlin/CharSequence?|): R|kotlin/String?|
|
@R|NullableApi|() public open fun foobar(x: R|ft<kotlin/String, kotlin/String?>|, @R|javax/annotation/Nullable|() y: R|kotlin/CharSequence?|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun bar(): R|@EnhancedNullability kotlin/String|
|
public open fun bar(): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|javax/annotation/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>>?>|
|
@R|javax/annotation/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>>?>|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
@R|javax/annotation/ParametersAreNonnullByDefault|() public open class A : R|kotlin/Any| {
|
@R|javax/annotation/ParametersAreNonnullByDefault|() public open class A : R|kotlin/Any| {
|
||||||
@R|javax/annotation/Nullable|() public open field field: R|kotlin/String?|
|
@R|javax/annotation/Nullable|() public open field field: R|kotlin/String?|
|
||||||
|
|
||||||
public open fun foo(q: R|@EnhancedNullability kotlin/String|, @R|javax/annotation/Nonnull|() x: R|@EnhancedNullability kotlin/String|, @R|javax/annotation/CheckForNull|() y: R|kotlin/CharSequence?|): R|ft<kotlin/String, kotlin/String?>|
|
public open fun foo(q: R|ft<kotlin/String, kotlin/String?>|, @R|javax/annotation/Nonnull|() x: R|@EnhancedNullability kotlin/String|, @R|javax/annotation/CheckForNull|() y: R|kotlin/CharSequence?|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|javax/annotation/Nonnull|() public open fun bar(): R|@EnhancedNullability kotlin/String|
|
@R|javax/annotation/Nonnull|() public open fun bar(): R|@EnhancedNullability kotlin/String|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
public open class A : R|kotlin/Any| {
|
public open class A : R|kotlin/Any| {
|
||||||
@R|javax/annotation/Nullable|() public open field field: R|kotlin/String?|
|
@R|javax/annotation/Nullable|() public open field field: R|kotlin/String?|
|
||||||
|
|
||||||
public open fun foo(q: R|@EnhancedNullability kotlin/String|, @R|javax/annotation/Nonnull|() x: R|@EnhancedNullability kotlin/String|, @R|javax/annotation/CheckForNull|() y: R|kotlin/CharSequence?|): R|ft<kotlin/String, kotlin/String?>|
|
public open fun foo(q: R|ft<kotlin/String, kotlin/String?>|, @R|javax/annotation/Nonnull|() x: R|@EnhancedNullability kotlin/String|, @R|javax/annotation/CheckForNull|() y: R|kotlin/CharSequence?|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|javax/annotation/Nonnull|() public open fun bar(): R|@EnhancedNullability kotlin/String|
|
@R|javax/annotation/Nonnull|() public open fun bar(): R|@EnhancedNullability kotlin/String|
|
||||||
|
|
||||||
|
|||||||
Vendored
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
@R|spr/NonNullApi|() public open class A : R|kotlin/Any| {
|
@R|spr/NonNullApi|() public open class A : R|kotlin/Any| {
|
||||||
public open field field: R|ft<kotlin/String, kotlin/String?>|
|
public open field field: R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun foo(x: R|@EnhancedNullability kotlin/String|, @R|spr/Nullable|() y: R|kotlin/CharSequence?|): R|@EnhancedNullability kotlin/String|
|
public open fun foo(x: R|ft<kotlin/String, kotlin/String?>|, @R|spr/Nullable|() y: R|ft<kotlin/CharSequence, kotlin/CharSequence?>|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun bar(): R|@EnhancedNullability kotlin/String|
|
public open fun bar(): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|spr/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>>?>|
|
@R|spr/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>>, kotlin/collections/List<ft<kotlin/String, kotlin/String?>>?>|
|
||||||
|
|
||||||
public constructor(): R|A|
|
public constructor(): R|A|
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,11 +1,11 @@
|
|||||||
public open class A : R|kotlin/Any| {
|
public open class A : R|kotlin/Any| {
|
||||||
public open field field: R|ft<kotlin/String, kotlin/String?>|
|
public open field field: R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun foo(x: R|@EnhancedNullability kotlin/String|, @R|spr/Nullable|() y: R|kotlin/CharSequence?|): R|@EnhancedNullability kotlin/String|
|
public open fun foo(x: R|ft<kotlin/String, kotlin/String?>|, @R|spr/Nullable|() y: R|ft<kotlin/CharSequence, kotlin/CharSequence?>|): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
public open fun bar(): R|@EnhancedNullability kotlin/String|
|
public open fun bar(): R|ft<kotlin/String, kotlin/String?>|
|
||||||
|
|
||||||
@R|spr/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>>?, kotlin/collections/List<ft<kotlin/String, kotlin/String?>>?>|
|
@R|spr/Nullable|() public open fun baz(): R|ft<kotlin/collections/MutableList<ft<kotlin/String, kotlin/String?>>, kotlin/collections/List<ft<kotlin/String, kotlin/String?>>?>|
|
||||||
|
|
||||||
public constructor(): R|test/A|
|
public constructor(): R|test/A|
|
||||||
|
|
||||||
|
|||||||
@@ -113,7 +113,9 @@ private fun ConeKotlinType.enhanceInflexibleType(
|
|||||||
val effectiveQualifiers = qualifiers(index)
|
val effectiveQualifiers = qualifiers(index)
|
||||||
val enhancedTag = lookupTag.enhanceMutability(effectiveQualifiers, position)
|
val enhancedTag = lookupTag.enhanceMutability(effectiveQualifiers, position)
|
||||||
|
|
||||||
val nullabilityFromQualifiers = effectiveQualifiers.nullability.takeIf { shouldEnhance }
|
// TODO: implement warnings
|
||||||
|
val nullabilityFromQualifiers = effectiveQualifiers.nullability
|
||||||
|
.takeIf { shouldEnhance && !effectiveQualifiers.isNullabilityQualifierForWarning }
|
||||||
val enhancedNullability = when (nullabilityFromQualifiers) {
|
val enhancedNullability = when (nullabilityFromQualifiers) {
|
||||||
NullabilityQualifier.NULLABLE -> true
|
NullabilityQualifier.NULLABLE -> true
|
||||||
NullabilityQualifier.NOT_NULL -> false
|
NullabilityQualifier.NOT_NULL -> false
|
||||||
@@ -138,7 +140,6 @@ private fun ConeKotlinType.enhanceInflexibleType(
|
|||||||
return null // absolutely no changes
|
return null // absolutely no changes
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: val nullabilityForWarning = enhancedNullabilityAttribute != null && effectiveQualifiers.isNullabilityQualifierForWarning
|
|
||||||
val mergedArguments = Array(typeArguments.size) { enhancedArguments[it] ?: typeArguments[it] }
|
val mergedArguments = Array(typeArguments.size) { enhancedArguments[it] ?: typeArguments[it] }
|
||||||
val mergedAttributes = if (shouldAddAttribute) attributes + CompilerConeAttributes.EnhancedNullability else attributes
|
val mergedAttributes = if (shouldAddAttribute) attributes + CompilerConeAttributes.EnhancedNullability else attributes
|
||||||
val enhancedType = enhancedTag.constructType(mergedArguments, enhancedNullability, mergedAttributes)
|
val enhancedType = enhancedTag.constructType(mergedArguments, enhancedNullability, mergedAttributes)
|
||||||
|
|||||||
+9
-9
@@ -43,8 +43,8 @@ fun main(
|
|||||||
|
|
||||||
b: AnnotatedBoundsOfWildcard
|
b: AnnotatedBoundsOfWildcard
|
||||||
): Unit {
|
): Unit {
|
||||||
b.superAsIs(<!ARGUMENT_TYPE_MISMATCH!>aAnyNotNullNotNullNotNull<!>)
|
b.superAsIs(aAnyNotNullNotNullNotNull)
|
||||||
b.superAsIs(<!ARGUMENT_TYPE_MISMATCH!>aAnyNotNullNotNullNull<!>)
|
b.superAsIs(aAnyNotNullNotNullNull)
|
||||||
b.superAsIs(aAnyNotNullNullNotNull)
|
b.superAsIs(aAnyNotNullNullNotNull)
|
||||||
b.superAsIs(aAnyNotNullNullNull)
|
b.superAsIs(aAnyNotNullNullNull)
|
||||||
|
|
||||||
@@ -53,10 +53,10 @@ fun main(
|
|||||||
b.superNotNull(aAnyNotNullNullNotNull)
|
b.superNotNull(aAnyNotNullNullNotNull)
|
||||||
b.superNotNull(aAnyNotNullNullNull)
|
b.superNotNull(aAnyNotNullNullNull)
|
||||||
|
|
||||||
b.superNullable(<!ARGUMENT_TYPE_MISMATCH!>aAnyNotNullNotNullNotNull<!>)
|
b.superNullable(aAnyNotNullNotNullNotNull)
|
||||||
b.superNullable(<!ARGUMENT_TYPE_MISMATCH!>aAnyNotNullNotNullNull<!>)
|
b.superNullable(aAnyNotNullNotNullNull)
|
||||||
b.superNullable(<!ARGUMENT_TYPE_MISMATCH!>aAnyNotNullNullNotNull<!>)
|
b.superNullable(aAnyNotNullNullNotNull)
|
||||||
b.superNullable(<!ARGUMENT_TYPE_MISMATCH!>aAnyNotNullNullNull<!>)
|
b.superNullable(aAnyNotNullNullNull)
|
||||||
|
|
||||||
b.extendsAsIs(aNotNullNotNullNotNull)
|
b.extendsAsIs(aNotNullNotNullNotNull)
|
||||||
b.extendsAsIs(aNotNullNotNullNull)
|
b.extendsAsIs(aNotNullNotNullNull)
|
||||||
@@ -64,9 +64,9 @@ fun main(
|
|||||||
b.extendsAsIs(aNotNullNullNull)
|
b.extendsAsIs(aNotNullNullNull)
|
||||||
|
|
||||||
b.extendsNotNull(aNotNullNotNullNotNull)
|
b.extendsNotNull(aNotNullNotNullNotNull)
|
||||||
b.extendsNotNull(<!ARGUMENT_TYPE_MISMATCH!>aNotNullNotNullNull<!>)
|
b.extendsNotNull(aNotNullNotNullNull)
|
||||||
b.extendsNotNull(<!ARGUMENT_TYPE_MISMATCH!>aNotNullNullNotNull<!>)
|
b.extendsNotNull(aNotNullNullNotNull)
|
||||||
b.extendsNotNull(<!ARGUMENT_TYPE_MISMATCH!>aNotNullNullNull<!>)
|
b.extendsNotNull(aNotNullNullNull)
|
||||||
|
|
||||||
b.extendsNullable(aNotNullNotNullNotNull)
|
b.extendsNullable(aNotNullNotNullNotNull)
|
||||||
b.extendsNullable(aNotNullNotNullNull)
|
b.extendsNullable(aNotNullNotNullNull)
|
||||||
|
|||||||
Vendored
-17
@@ -1,17 +0,0 @@
|
|||||||
// JSPECIFY_STATE: warn
|
|
||||||
// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode
|
|
||||||
// FILE: J1.java
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
public interface J1<T> {
|
|
||||||
@Nullable
|
|
||||||
public static <T> T foo(J1<T> x) { return null; }
|
|
||||||
}
|
|
||||||
|
|
||||||
// FILE: J2.java
|
|
||||||
import org.jspecify.nullness.Nullable;
|
|
||||||
|
|
||||||
public interface J2<V extends @Nullable Object> extends J1<V> { }
|
|
||||||
|
|
||||||
// FILE: kotlin.kt
|
|
||||||
private fun J2<*>.bar() = <!NEW_INFERENCE_ERROR!>J1.foo(this)<!>
|
|
||||||
Vendored
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// JSPECIFY_STATE: warn
|
// JSPECIFY_STATE: warn
|
||||||
// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode
|
// !LANGUAGE: +TypeEnhancementImprovementsInStrictMode
|
||||||
// FILE: J1.java
|
// FILE: J1.java
|
||||||
|
|||||||
Vendored
+5
-5
@@ -26,20 +26,20 @@ public class Foo {
|
|||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(a: Defaults, x: Foo): Unit {
|
fun main(a: Defaults, x: Foo): Unit {
|
||||||
a.everythingNotNullable(<!NULL_FOR_NONNULL_TYPE!>null<!>).foo()
|
a.everythingNotNullable(null).foo()
|
||||||
a.everythingNotNullable(x).foo()
|
a.everythingNotNullable(x).foo()
|
||||||
|
|
||||||
a.everythingNullable(null)<!UNSAFE_CALL!>.<!>foo()
|
a.everythingNullable(null).foo()
|
||||||
|
|
||||||
a.everythingUnknown(null).foo()
|
a.everythingUnknown(null).foo()
|
||||||
|
|
||||||
a.mixed(<!NULL_FOR_NONNULL_TYPE!>null<!>)<!UNSAFE_CALL!>.<!>foo()
|
a.mixed(null).foo()
|
||||||
a.mixed(x)<!UNSAFE_CALL!>.<!>foo()
|
a.mixed(x).foo()
|
||||||
|
|
||||||
a.explicitlyNullnessUnspecified(x).foo()
|
a.explicitlyNullnessUnspecified(x).foo()
|
||||||
a.explicitlyNullnessUnspecified(null).foo()
|
a.explicitlyNullnessUnspecified(null).foo()
|
||||||
|
|
||||||
a.defaultField.foo()
|
a.defaultField.foo()
|
||||||
|
|
||||||
a.field<!UNSAFE_CALL!>.<!>foo()
|
a.field.foo()
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -29,15 +29,15 @@ public class Derived extends Base { }
|
|||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(a: IgnoreAnnotations, x: Derived): Unit {
|
fun main(a: IgnoreAnnotations, x: Derived): Unit {
|
||||||
a.foo(x, null)<!UNSAFE_CALL!>.<!>foo()
|
a.foo(x, null).foo()
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, x)<!UNSAFE_CALL!>.<!>foo()
|
a.foo(null, x).foo()
|
||||||
|
|
||||||
a.field<!UNSAFE_CALL!>.<!>foo()
|
a.field.foo()
|
||||||
|
|
||||||
a.everythingNotNullable(<!NULL_FOR_NONNULL_TYPE!>null<!>).foo()
|
a.everythingNotNullable(null).foo()
|
||||||
a.everythingNotNullable(x).foo()
|
a.everythingNotNullable(x).foo()
|
||||||
|
|
||||||
a.everythingNullable(null)<!UNSAFE_CALL!>.<!>foo()
|
a.everythingNullable(null).foo()
|
||||||
|
|
||||||
a.everythingUnknown(null).foo()
|
a.everythingUnknown(null).foo()
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -17,11 +17,11 @@ public class Test {}
|
|||||||
fun <T : Test> main(a1: NonPlatformTypeParameter<Any?>, a2: NonPlatformTypeParameter<Test>, x: T): Unit {
|
fun <T : Test> main(a1: NonPlatformTypeParameter<Any?>, a2: NonPlatformTypeParameter<Test>, x: T): Unit {
|
||||||
a1.foo(null)
|
a1.foo(null)
|
||||||
a1.bar<Test?>(null)
|
a1.bar<Test?>(null)
|
||||||
a1.bar<T>(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
a1.bar<T>(null)
|
||||||
a1.bar<T>(x)
|
a1.bar<T>(x)
|
||||||
|
|
||||||
a2.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
a2.foo(null)
|
||||||
a2.bar<Test?>(null)
|
a2.bar<Test?>(null)
|
||||||
a2.bar<T>(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
a2.bar<T>(null)
|
||||||
a2.bar<T>(x)
|
a2.bar<T>(x)
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-5
@@ -13,18 +13,18 @@ public class NullnessUnspecifiedTypeParameter<T> {
|
|||||||
public class Test {}
|
public class Test {}
|
||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(a1: NullnessUnspecifiedTypeParameter<Any>, a2: NullnessUnspecifiedTypeParameter<<!UPPER_BOUND_VIOLATED!>Any?<!>>, x: Test): Unit {
|
fun main(a1: NullnessUnspecifiedTypeParameter<Any>, a2: NullnessUnspecifiedTypeParameter<Any?>, x: Test): Unit {
|
||||||
a1.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
a1.foo(null)
|
||||||
a1.foo(1)
|
a1.foo(1)
|
||||||
|
|
||||||
a2.foo(null)
|
a2.foo(null)
|
||||||
a2.foo(1)
|
a2.foo(1)
|
||||||
|
|
||||||
a1.bar(<!NULL_FOR_NONNULL_TYPE!>null<!>, <!NULL_FOR_NONNULL_TYPE!>null<!>)
|
a1.bar(null, null)
|
||||||
a1.bar(x, <!NULL_FOR_NONNULL_TYPE!>null<!>)
|
a1.bar(x, null)
|
||||||
a1.bar(x, 1)
|
a1.bar(x, 1)
|
||||||
|
|
||||||
a2.bar(<!NULL_FOR_NONNULL_TYPE!>null<!>, null)
|
a2.bar(null, null)
|
||||||
a2.bar(x, null)
|
a2.bar(x, null)
|
||||||
a2.bar(x, 1)
|
a2.bar(x, 1)
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+3
-3
@@ -40,15 +40,15 @@ public class CKN extends C<@Nullable CK> {}
|
|||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit {
|
fun main(ak: AK, akn: AKN, bk: BK, ck: CK, ckn: CKN): Unit {
|
||||||
ak.foo(ak)
|
ak.foo(ak)
|
||||||
ak.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
ak.foo(null)
|
||||||
|
|
||||||
akn.foo(null) // the corresponding warning/error is present on the Java side
|
akn.foo(null) // the corresponding warning/error is present on the Java side
|
||||||
|
|
||||||
bk.foo(bk)
|
bk.foo(bk)
|
||||||
bk.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
bk.foo(null)
|
||||||
|
|
||||||
ck.foo(ck)
|
ck.foo(ck)
|
||||||
ck.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
ck.foo(null)
|
||||||
|
|
||||||
ckn.foo(null) // the corresponding warning/error is present on the Java side
|
ckn.foo(null) // the corresponding warning/error is present on the Java side
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+3
-3
@@ -27,10 +27,10 @@ public class Derived extends Base {
|
|||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(a: Simple, x: Derived): Unit {
|
fun main(a: Simple, x: Derived): Unit {
|
||||||
a.foo(x, null)<!UNSAFE_CALL!>.<!>foo()
|
a.foo(x, null).foo()
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, x)<!UNSAFE_CALL!>.<!>foo()
|
a.foo(null, x).foo()
|
||||||
|
|
||||||
a.bar().foo()
|
a.bar().foo()
|
||||||
|
|
||||||
a.field<!UNSAFE_CALL!>.<!>foo()
|
a.field.foo()
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -34,9 +34,9 @@ fun main(
|
|||||||
a: A, b: B
|
a: A, b: B
|
||||||
): Unit {
|
): Unit {
|
||||||
a.bar(aNotNullNotNullNotNull)
|
a.bar(aNotNullNotNullNotNull)
|
||||||
a.bar(<!ARGUMENT_TYPE_MISMATCH!>aNotNullNotNullNull<!>)
|
a.bar(aNotNullNotNullNull)
|
||||||
a.bar(<!ARGUMENT_TYPE_MISMATCH!>aNotNullNullNotNull<!>)
|
a.bar(aNotNullNullNotNull)
|
||||||
a.bar(<!ARGUMENT_TYPE_MISMATCH!>aNotNullNullNull<!>)
|
a.bar(aNotNullNullNull)
|
||||||
|
|
||||||
b.bar(aNotNullNotNullNotNull)
|
b.bar(aNotNullNotNullNotNull)
|
||||||
b.bar(aNotNullNotNullNull)
|
b.bar(aNotNullNotNullNull)
|
||||||
|
|||||||
+6
-6
@@ -20,20 +20,20 @@ public class B<T> {
|
|||||||
public class Test {}
|
public class Test {}
|
||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun <T : Test> main(a1: A<<!UPPER_BOUND_VIOLATED!>Any?<!>>, a2: A<Test>, b1: B<<!UPPER_BOUND_VIOLATED!>Any?<!>>, b2: B<Test>, x: T): Unit {
|
fun <T : Test> main(a1: A<Any?>, a2: A<Test>, b1: B<Any?>, b2: B<Test>, x: T): Unit {
|
||||||
a1.foo(null)
|
a1.foo(null)
|
||||||
a1.bar<<!UPPER_BOUND_VIOLATED!>T?<!>>(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
a1.bar<T?>(null)
|
||||||
a1.bar<T>(x)
|
a1.bar<T>(x)
|
||||||
|
|
||||||
a2.foo(null)
|
a2.foo(null)
|
||||||
a2.bar<<!UPPER_BOUND_VIOLATED!>T?<!>>(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
a2.bar<T?>(null)
|
||||||
a2.bar<T>(x)
|
a2.bar<T>(x)
|
||||||
|
|
||||||
b1.foo(null)
|
b1.foo(null)
|
||||||
b1.bar<<!UPPER_BOUND_VIOLATED!>T?<!>>(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
b1.bar<T?>(null)
|
||||||
b1.bar<T>(x)
|
b1.bar<T>(x)
|
||||||
|
|
||||||
b2.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
b2.foo(null)
|
||||||
b2.bar<<!UPPER_BOUND_VIOLATED!>T?<!>>(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
b2.bar<T?>(null)
|
||||||
b2.bar<T>(x)
|
b2.bar<T>(x)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -21,5 +21,5 @@ public class Test {
|
|||||||
import test.Test
|
import test.Test
|
||||||
|
|
||||||
fun main(x: Test) {
|
fun main(x: Test) {
|
||||||
x.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
x.foo(null)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -24,5 +24,5 @@ public class Test {
|
|||||||
import test.Test
|
import test.Test
|
||||||
|
|
||||||
fun main(x: Test) {
|
fun main(x: Test) {
|
||||||
x.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
x.foo(null)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -27,5 +27,5 @@ public class Test {
|
|||||||
import test.Test
|
import test.Test
|
||||||
|
|
||||||
fun main(x: Test) {
|
fun main(x: Test) {
|
||||||
x.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
x.foo(null)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -26,5 +26,5 @@ public class Test {
|
|||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(y: test2.Test) {
|
fun main(y: test2.Test) {
|
||||||
y.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
y.foo(null)
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -21,5 +21,5 @@ public class Test {
|
|||||||
import my.test.Test
|
import my.test.Test
|
||||||
|
|
||||||
fun main(x: Test) {
|
fun main(x: Test) {
|
||||||
x.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
x.foo(null)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -39,7 +39,7 @@ import test1.Test1
|
|||||||
import test2.Test2
|
import test2.Test2
|
||||||
|
|
||||||
fun main(x: Test1, y: Test2) {
|
fun main(x: Test1, y: Test2) {
|
||||||
x.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
x.foo(null)
|
||||||
y.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
y.foo(null)
|
||||||
y.foo2(null)
|
y.foo2(null)
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -35,9 +35,9 @@ public class Test {
|
|||||||
import test.Test
|
import test.Test
|
||||||
|
|
||||||
fun main(x: Test) {
|
fun main(x: Test) {
|
||||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>x.Test3().foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)<!>
|
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int..kotlin.Int?!")!>x.Test3().foo(null)<!>
|
||||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>x.Test3().Test5().foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)<!>
|
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int..kotlin.Int?!")!>x.Test3().Test5().foo(null)<!>
|
||||||
|
|
||||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>Test.Test2().foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)<!>
|
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int..kotlin.Int?!")!>Test.Test2().foo(null)<!>
|
||||||
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int")!>Test.Test2().Test5().foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)<!>
|
<!DEBUG_INFO_EXPRESSION_TYPE("kotlin.Int..kotlin.Int?!")!>Test.Test2().Test5().foo(null)<!>
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -34,6 +34,6 @@ public class Test {
|
|||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(x: test1.Test, y: test2.Test) {
|
fun main(x: test1.Test, y: test2.Test) {
|
||||||
x.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
x.foo(null)
|
||||||
y.foo(null)
|
y.foo(null)
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-11
@@ -26,27 +26,27 @@ public class A<T> {
|
|||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(a: A<String>, a1: A<String?>) {
|
fun main(a: A<String>, a1: A<String?>) {
|
||||||
a.foo("", null)?.length
|
a.foo("", null)?.length
|
||||||
a.foo("", null)<!UNSAFE_CALL!>.<!>length
|
a.foo("", null).length
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
|
a.foo(null, "").length
|
||||||
|
|
||||||
a.bar().length
|
a.bar().length
|
||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()!!.length
|
||||||
|
|
||||||
a.field?.length
|
a.field?.length
|
||||||
a.field<!UNSAFE_CALL!>.<!>length
|
a.field.length
|
||||||
|
|
||||||
a.baz("")<!UNSAFE_CALL!>.<!>length
|
a.baz("").length
|
||||||
a.baz("")?.length
|
a.baz("")?.length
|
||||||
a.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)<!UNSAFE_CALL!>.<!>length
|
a.baz(null).length
|
||||||
|
|
||||||
a1.baz("")!!.length
|
a1.baz("")!!.length
|
||||||
a1.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)!!.length
|
a1.baz(null)!!.length
|
||||||
|
|
||||||
a.baz2("").length
|
a.baz2("").length
|
||||||
a.baz2("")<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
a.baz2("")?.length
|
||||||
a.baz2("")<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.baz2("")!!.length
|
||||||
|
|
||||||
a.baz2(null).length
|
a.baz2(null).length
|
||||||
a.baz2(null)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
a.baz2(null)?.length
|
||||||
a.baz2(null)<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.baz2(null)!!.length
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
// JSR305_GLOBAL_REPORT: warn
|
// JSR305_GLOBAL_REPORT: warn
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -16,11 +16,11 @@ fun test() {
|
|||||||
var platformJ = J.staticJ
|
var platformJ = J.staticJ
|
||||||
|
|
||||||
+platformNN
|
+platformNN
|
||||||
<!UNSAFE_CALL!>+<!>platformN
|
+platformN
|
||||||
+platformJ
|
+platformJ
|
||||||
|
|
||||||
++platformNN
|
++platformNN
|
||||||
<!UNSAFE_CALL!>++<!>platformN
|
++platformN
|
||||||
++platformJ
|
++platformJ
|
||||||
|
|
||||||
platformNN++
|
platformNN++
|
||||||
|
|||||||
+2
-2
@@ -16,10 +16,10 @@ fun test() {
|
|||||||
val platformJ = J.staticJ
|
val platformJ = J.staticJ
|
||||||
|
|
||||||
platformNN[0]
|
platformNN[0]
|
||||||
<!UNSAFE_CALL!>platformN[0]<!>
|
platformN[0]
|
||||||
platformJ[0]
|
platformJ[0]
|
||||||
|
|
||||||
platformNN[0] = 1
|
platformNN[0] = 1
|
||||||
<!UNSAFE_CALL!>platformN[0]<!> = 1
|
platformN[0] = 1
|
||||||
platformJ[0] = 1
|
platformJ[0] = 1
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ var n: J? = J()
|
|||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
v = J.staticNN
|
v = J.staticNN
|
||||||
v = <!ASSIGNMENT_TYPE_MISMATCH!>J.staticN<!>
|
v = J.staticN
|
||||||
v = J.staticJ
|
v = J.staticJ
|
||||||
|
|
||||||
n = J.staticNN
|
n = J.staticNN
|
||||||
|
|||||||
+6
-6
@@ -17,26 +17,26 @@ fun test() {
|
|||||||
val platformJ = J.staticJ
|
val platformJ = J.staticJ
|
||||||
|
|
||||||
if (platformNN) {}
|
if (platformNN) {}
|
||||||
if (<!CONDITION_TYPE_MISMATCH!>platformN<!>) {}
|
if (platformN) {}
|
||||||
if (platformJ) {}
|
if (platformJ) {}
|
||||||
|
|
||||||
while (platformNN) {}
|
while (platformNN) {}
|
||||||
while (<!CONDITION_TYPE_MISMATCH!>platformN<!>) {}
|
while (platformN) {}
|
||||||
while (platformJ) {}
|
while (platformJ) {}
|
||||||
|
|
||||||
do {} while (platformNN)
|
do {} while (platformNN)
|
||||||
do {} while (<!CONDITION_TYPE_MISMATCH!>platformN<!>)
|
do {} while (platformN)
|
||||||
do {} while (platformJ)
|
do {} while (platformJ)
|
||||||
|
|
||||||
platformNN && false
|
platformNN && false
|
||||||
<!CONDITION_TYPE_MISMATCH!>platformN<!> && false
|
platformN && false
|
||||||
platformJ && false
|
platformJ && false
|
||||||
|
|
||||||
platformNN || false
|
platformNN || false
|
||||||
<!CONDITION_TYPE_MISMATCH!>platformN<!> || false
|
platformN || false
|
||||||
platformJ || false
|
platformJ || false
|
||||||
|
|
||||||
!platformNN
|
!platformNN
|
||||||
<!UNSAFE_CALL!>!<!>platformN
|
!platformN
|
||||||
!platformJ
|
!platformJ
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -12,15 +12,15 @@ public class J {
|
|||||||
// FILE: k.kt
|
// FILE: k.kt
|
||||||
fun test() {
|
fun test() {
|
||||||
val n = J.staticN
|
val n = J.staticN
|
||||||
foo(<!ARGUMENT_TYPE_MISMATCH!>n<!>)
|
foo(n)
|
||||||
J.staticNN = <!ASSIGNMENT_TYPE_MISMATCH!>n<!>
|
J.staticNN = n
|
||||||
if (n != null) {
|
if (n != null) {
|
||||||
foo(n)
|
foo(n)
|
||||||
J.staticNN = n
|
J.staticNN = n
|
||||||
}
|
}
|
||||||
|
|
||||||
val x: J? = null
|
val x: J? = null
|
||||||
J.staticNN = <!ASSIGNMENT_TYPE_MISMATCH!>x<!>
|
J.staticNN = x
|
||||||
if (x != null) {
|
if (x != null) {
|
||||||
J.staticNN = x
|
J.staticNN = x
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -17,5 +17,5 @@ public class J {
|
|||||||
|
|
||||||
// FILE: k.kt
|
// FILE: k.kt
|
||||||
var A by J.staticNN
|
var A by J.staticNN
|
||||||
var B by <!DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE, DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE!>J.staticN<!>
|
var B by J.staticN
|
||||||
var C by J.staticJ
|
var C by J.staticJ
|
||||||
|
|||||||
+2
-2
@@ -17,14 +17,14 @@ fun test() {
|
|||||||
val platformJ = J.staticJ
|
val platformJ = J.staticJ
|
||||||
|
|
||||||
platformNN.foo()
|
platformNN.foo()
|
||||||
platformN<!UNSAFE_CALL!>.<!>foo()
|
platformN.foo()
|
||||||
platformJ.foo()
|
platformJ.foo()
|
||||||
|
|
||||||
with(platformNN) {
|
with(platformNN) {
|
||||||
foo()
|
foo()
|
||||||
}
|
}
|
||||||
with(platformN) {
|
with(platformN) {
|
||||||
<!UNSAFE_CALL!>foo<!>()
|
foo()
|
||||||
}
|
}
|
||||||
with(platformJ) {
|
with(platformJ) {
|
||||||
foo()
|
foo()
|
||||||
|
|||||||
+2
-2
@@ -22,14 +22,14 @@ fun test() {
|
|||||||
val platformJ = J.staticJ
|
val platformJ = J.staticJ
|
||||||
|
|
||||||
platformNN.foo()
|
platformNN.foo()
|
||||||
platformN<!UNSAFE_CALL!>.<!>foo()
|
platformN.foo()
|
||||||
platformJ.foo()
|
platformJ.foo()
|
||||||
|
|
||||||
with(platformNN) {
|
with(platformNN) {
|
||||||
foo()
|
foo()
|
||||||
}
|
}
|
||||||
with(platformN) {
|
with(platformN) {
|
||||||
<!UNSAFE_CALL!>foo<!>()
|
foo()
|
||||||
}
|
}
|
||||||
with(platformJ) {
|
with(platformJ) {
|
||||||
foo()
|
foo()
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@ fun test() {
|
|||||||
val platformJ = J.staticJ
|
val platformJ = J.staticJ
|
||||||
|
|
||||||
checkSubtype<J>(platformNN)
|
checkSubtype<J>(platformNN)
|
||||||
checkSubtype<J>(<!ARGUMENT_TYPE_MISMATCH!>platformN<!>)
|
checkSubtype<J>(platformN)
|
||||||
checkSubtype<J>(platformJ)
|
checkSubtype<J>(platformJ)
|
||||||
|
|
||||||
checkSubtype<J?>(platformNN)
|
checkSubtype<J?>(platformNN)
|
||||||
|
|||||||
+1
-1
@@ -18,6 +18,6 @@ fun test() {
|
|||||||
val platformJ = J.staticJ
|
val platformJ = J.staticJ
|
||||||
|
|
||||||
for (x in platformNN) {}
|
for (x in platformNN) {}
|
||||||
for (x in <!ITERATOR_ON_NULLABLE!>platformN<!>) {}
|
for (x in platformN) {}
|
||||||
for (x in platformJ) {}
|
for (x in platformJ) {}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ public class J {
|
|||||||
// FILE: k.kt
|
// FILE: k.kt
|
||||||
fun test() {
|
fun test() {
|
||||||
foo(J.staticNN)
|
foo(J.staticNN)
|
||||||
foo(<!ARGUMENT_TYPE_MISMATCH!>J.staticN<!>)
|
foo(J.staticN)
|
||||||
foo(J.staticJ)
|
foo(J.staticJ)
|
||||||
|
|
||||||
bar(J.staticNN)
|
bar(J.staticNN)
|
||||||
|
|||||||
+1
-1
@@ -16,6 +16,6 @@ public class J {
|
|||||||
// FILE: k.kt
|
// FILE: k.kt
|
||||||
fun test() {
|
fun test() {
|
||||||
J.staticNN()
|
J.staticNN()
|
||||||
J.<!UNSAFE_IMPLICIT_INVOKE_CALL!>staticN<!>()
|
J.staticN()
|
||||||
J.staticJ()
|
J.staticJ()
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ public class J {
|
|||||||
// FILE: k.kt
|
// FILE: k.kt
|
||||||
fun foo(collection: Collection<J>) {
|
fun foo(collection: Collection<J>) {
|
||||||
val mapped = collection.map { it.method() }
|
val mapped = collection.map { it.method() }
|
||||||
mapped[0]<!UNSAFE_CALL!>.<!>length
|
mapped[0].length
|
||||||
}
|
}
|
||||||
|
|
||||||
public fun <T, R> Iterable<T>.map(transform: (T) -> R): List<R> {
|
public fun <T, R> Iterable<T>.map(transform: (T) -> R): List<R> {
|
||||||
|
|||||||
+1
-1
@@ -22,6 +22,6 @@ fun test() {
|
|||||||
val platformJ = J.staticJ
|
val platformJ = J.staticJ
|
||||||
|
|
||||||
val (a1, b1) = platformNN
|
val (a1, b1) = platformNN
|
||||||
val (a2, b2) = <!COMPONENT_FUNCTION_ON_NULLABLE, COMPONENT_FUNCTION_ON_NULLABLE!>platformN<!>
|
val (a2, b2) = platformN
|
||||||
val (a3, b3) = platformJ
|
val (a3, b3) = platformJ
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-10
@@ -32,8 +32,8 @@ fun test(n: J?, nn: J) {
|
|||||||
// platform type with no annotation
|
// platform type with no annotation
|
||||||
val platformJ = J.staticJ
|
val platformJ = J.staticJ
|
||||||
|
|
||||||
J.staticNN = <!ASSIGNMENT_TYPE_MISMATCH!>n<!>
|
J.staticNN = n
|
||||||
J.staticNN = <!ASSIGNMENT_TYPE_MISMATCH!>platformN<!>
|
J.staticNN = platformN
|
||||||
J.staticNN = nn
|
J.staticNN = nn
|
||||||
J.staticNN = platformNN
|
J.staticNN = platformNN
|
||||||
J.staticNN = platformJ
|
J.staticNN = platformJ
|
||||||
@@ -52,12 +52,12 @@ fun test(n: J?, nn: J) {
|
|||||||
|
|
||||||
J.staticSet(nn, nn, nn)
|
J.staticSet(nn, nn, nn)
|
||||||
J.staticSet(platformNN, platformNN, platformNN)
|
J.staticSet(platformNN, platformNN, platformNN)
|
||||||
J.staticSet(<!ARGUMENT_TYPE_MISMATCH!>n<!>, n, n)
|
J.staticSet(n, n, n)
|
||||||
J.staticSet(<!ARGUMENT_TYPE_MISMATCH!>platformN<!>, platformN, platformN)
|
J.staticSet(platformN, platformN, platformN)
|
||||||
J.staticSet(platformJ, platformJ, platformJ)
|
J.staticSet(platformJ, platformJ, platformJ)
|
||||||
|
|
||||||
J().nn = <!ASSIGNMENT_TYPE_MISMATCH!>n<!>
|
J().nn = n
|
||||||
J().nn = <!ASSIGNMENT_TYPE_MISMATCH!>platformN<!>
|
J().nn = platformN
|
||||||
J().nn = nn
|
J().nn = nn
|
||||||
J().nn = platformNN
|
J().nn = platformNN
|
||||||
J().nn = platformJ
|
J().nn = platformJ
|
||||||
@@ -76,13 +76,13 @@ fun test(n: J?, nn: J) {
|
|||||||
|
|
||||||
J().set(nn, nn, nn)
|
J().set(nn, nn, nn)
|
||||||
J().set(platformNN, platformNN, platformNN)
|
J().set(platformNN, platformNN, platformNN)
|
||||||
J().set(<!ARGUMENT_TYPE_MISMATCH!>n<!>, n, n)
|
J().set(n, n, n)
|
||||||
J().set(<!ARGUMENT_TYPE_MISMATCH!>platformN<!>, platformN, platformN)
|
J().set(platformN, platformN, platformN)
|
||||||
J().set(platformJ, platformJ, platformJ)
|
J().set(platformJ, platformJ, platformJ)
|
||||||
|
|
||||||
J(nn, nn, nn)
|
J(nn, nn, nn)
|
||||||
J(platformNN, platformNN, platformNN)
|
J(platformNN, platformNN, platformNN)
|
||||||
J(<!ARGUMENT_TYPE_MISMATCH!>n<!>, n, n)
|
J(n, n, n)
|
||||||
J(<!ARGUMENT_TYPE_MISMATCH!>platformN<!>, platformN, platformN)
|
J(platformN, platformN, platformN)
|
||||||
J(platformJ, platformJ, platformJ)
|
J(platformJ, platformJ, platformJ)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -16,10 +16,10 @@ fun test() {
|
|||||||
val platformJ = J.staticJ
|
val platformJ = J.staticJ
|
||||||
|
|
||||||
platformNN[0]
|
platformNN[0]
|
||||||
<!UNSAFE_CALL!>platformN[0]<!>
|
platformN[0]
|
||||||
platformJ[0]
|
platformJ[0]
|
||||||
|
|
||||||
platformNN[0] = 1
|
platformNN[0] = 1
|
||||||
<!UNSAFE_CALL!>platformN[0]<!> = 1
|
platformN[0] = 1
|
||||||
platformJ[0] = 1
|
platformJ[0] = 1
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ fun test() {
|
|||||||
foo(a)
|
foo(a)
|
||||||
val b = JJ.staticNN <!USELESS_ELVIS_RIGHT_IS_NULL!>?: null<!>
|
val b = JJ.staticNN <!USELESS_ELVIS_RIGHT_IS_NULL!>?: null<!>
|
||||||
foo(b)
|
foo(b)
|
||||||
val c = JJJ.staticNNN <!USELESS_ELVIS!>?: null<!>
|
val c = JJJ.staticNNN <!USELESS_ELVIS_RIGHT_IS_NULL!>?: null<!>
|
||||||
foo(c)
|
foo(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -69,7 +69,7 @@ val f = platformNullable?.string
|
|||||||
|
|
||||||
fun evlis() {
|
fun evlis() {
|
||||||
// JSR
|
// JSR
|
||||||
val r1 = a <!USELESS_ELVIS!>?: ""<!>
|
val r1 = a ?: ""
|
||||||
val r2 = b ?: ""
|
val r2 = b ?: ""
|
||||||
|
|
||||||
// JB
|
// JB
|
||||||
@@ -83,7 +83,7 @@ fun evlis() {
|
|||||||
|
|
||||||
fun ifChecksAndSmartCasts() {
|
fun ifChecksAndSmartCasts() {
|
||||||
// JSR
|
// JSR
|
||||||
val r1 = if (<!SENSELESS_COMPARISON!>a == null<!>) 42 else a.length
|
val r1 = if (a == null) 42 else a.length
|
||||||
val r2 = if (b == null) 42 else b.length
|
val r2 = if (b == null) 42 else b.length
|
||||||
|
|
||||||
// JB
|
// JB
|
||||||
|
|||||||
+5
-5
@@ -25,16 +25,16 @@ class X<T>(t: T?) {
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
val a = A<T>()
|
val a = A<T>()
|
||||||
a.foo(<!ARGUMENT_TYPE_MISMATCH!>t<!>)
|
a.foo(t)
|
||||||
|
|
||||||
val x: T = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>a.bam()<!>
|
val x: T = a.bam()
|
||||||
val y: T = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>a.baz<T>()<!>
|
val y: T = a.baz<T>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun test() {
|
fun test() {
|
||||||
val a = A<String?>()
|
val a = A<String?>()
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
a.foo(null)
|
||||||
|
|
||||||
val b: String = <!INITIALIZER_TYPE_MISMATCH, TYPE_MISMATCH!>a.bar()<!>
|
val b: String = a.bar()
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-6
@@ -77,15 +77,15 @@ public class A {
|
|||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(a: A) {
|
fun main(a: A) {
|
||||||
a.foo("", null)?.length
|
a.foo("", null)?.length
|
||||||
a.foo("", null)<!UNSAFE_CALL!>.<!>length
|
a.foo("", null).length
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
|
a.foo(null, "").length
|
||||||
|
|
||||||
a.baz("", null)<!UNSAFE_CALL!>.<!>length
|
a.baz("", null).length
|
||||||
a.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
|
a.baz(null, "").length
|
||||||
|
|
||||||
a.bar().length
|
a.bar().length
|
||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()!!.length
|
||||||
|
|
||||||
a.field?.length
|
a.field?.length
|
||||||
a.field<!UNSAFE_CALL!>.<!>length
|
a.field.length
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-20
@@ -60,26 +60,13 @@ val jbNullable: AnnotatedWithJB? = null
|
|||||||
val platform: PlainJava = PlainJava()
|
val platform: PlainJava = PlainJava()
|
||||||
val platformNullable: PlainJava? = null
|
val platformNullable: PlainJava? = null
|
||||||
|
|
||||||
object Elvis {
|
fun safeCalls() {
|
||||||
fun fromJava() {
|
val a = jsr.string?.length
|
||||||
val a = jsr.string <!USELESS_ELVIS!>?: ""<!>
|
val b = jsrNullable?.string?.length
|
||||||
val b = jsrNullable?.string ?: ""
|
|
||||||
|
|
||||||
val c = jb.string <!USELESS_ELVIS!>?: ""<!>
|
val c = jb.string<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||||
val d = jbNullable?.string ?: ""
|
val d = jbNullable?.string?.length
|
||||||
|
|
||||||
val e = platform.string ?: ""
|
val e = platform.string?.length
|
||||||
val f = platformNullable?.string ?: ""
|
val f = platformNullable?.string?.length
|
||||||
}
|
|
||||||
|
|
||||||
fun toJava(nullableString: String?) {
|
|
||||||
val b = jsr.consumeString(nullableString ?: "")
|
|
||||||
val d = jsrNullable?.consumeString(nullableString ?: "")
|
|
||||||
|
|
||||||
val f = jb.consumeString(nullableString ?: "")
|
|
||||||
val h = jbNullable?.consumeString(nullableString ?: "")
|
|
||||||
|
|
||||||
val j = platform.consumeString(nullableString ?: "")
|
|
||||||
val l = platformNullable?.consumeString(nullableString ?: "")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Vendored
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_IDENTICAL
|
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||||
// JSR305_GLOBAL_REPORT: warn
|
// JSR305_GLOBAL_REPORT: warn
|
||||||
|
|
||||||
|
|||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||||
|
// JSR305_GLOBAL_REPORT: warn
|
||||||
|
|
||||||
|
// FILE: spr/NonNullApi.java
|
||||||
|
package spr;
|
||||||
|
|
||||||
|
import java.lang.annotation.Documented;
|
||||||
|
import java.lang.annotation.ElementType;
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
|
import java.lang.annotation.Target;
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
import javax.annotation.meta.TypeQualifierDefault;
|
||||||
|
|
||||||
|
@Target(ElementType.TYPE)
|
||||||
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
@Documented
|
||||||
|
@Nonnull
|
||||||
|
@TypeQualifierDefault({ElementType.METHOD, ElementType.PARAMETER})
|
||||||
|
public @interface NonNullApi {
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: A.java
|
||||||
|
import spr.*;
|
||||||
|
|
||||||
|
@NonNullApi
|
||||||
|
public class A {
|
||||||
|
public String getBar() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
fun main(a: A) {
|
||||||
|
if (a.getBar() == "1" && a.hashCode() != 0) return
|
||||||
|
if (a.getBar() != "2" && a.hashCode() != 0) return
|
||||||
|
|
||||||
|
if (a.getBar() == null && a.hashCode() != 0) return
|
||||||
|
if (a.getBar() != null && a.hashCode() != 0) return
|
||||||
|
|
||||||
|
if (a.bar == "1" && a.hashCode() != 0) return
|
||||||
|
if (a.bar != "2" && a.hashCode() != 0) return
|
||||||
|
|
||||||
|
if (a.bar == null && a.hashCode() != 0) return
|
||||||
|
if (a.bar != null && a.hashCode() != 0) return
|
||||||
|
}
|
||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_IDENTICAL
|
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||||
// JSR305_GLOBAL_REPORT: warn
|
// JSR305_GLOBAL_REPORT: warn
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -48,7 +48,7 @@ fun main(a: A) {
|
|||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||||
|
|
||||||
a.field?.length
|
a.field?.length
|
||||||
a.field<!UNSAFE_CALL!>.<!>length
|
a.field.length
|
||||||
a.field = null
|
a.field = null
|
||||||
|
|
||||||
a.nonNullField<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
a.nonNullField<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
||||||
|
|||||||
+9
-9
@@ -126,25 +126,25 @@ public class C extends A implements AInt {
|
|||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(a: A, b: B, c: C) {
|
fun main(a: A, b: B, c: C) {
|
||||||
a.foo1(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
a.foo1(null).length
|
||||||
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
a.foo2(null).length
|
||||||
a.foo3(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
a.foo3(null).length
|
||||||
a.bar1(null)<!UNSAFE_CALL!>.<!>length
|
a.bar1(null)<!UNSAFE_CALL!>.<!>length
|
||||||
a.bar2(null)<!UNSAFE_CALL!>.<!>length
|
a.bar2(null)<!UNSAFE_CALL!>.<!>length
|
||||||
a.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
a.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
||||||
|
|
||||||
b.foo1(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
b.foo1(null).length
|
||||||
b.foo1(<!NULL_FOR_NONNULL_TYPE!>null<!>)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
b.foo1(null)?.length
|
||||||
b.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
b.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
||||||
b.foo3(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
b.foo3(null).length
|
||||||
b.bar1(null)<!UNSAFE_CALL!>.<!>length
|
b.bar1(null)<!UNSAFE_CALL!>.<!>length
|
||||||
b.bar2(null)<!UNSAFE_CALL!>.<!>length
|
b.bar2(null)<!UNSAFE_CALL!>.<!>length
|
||||||
b.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
b.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
||||||
b.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
b.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)?.length
|
||||||
|
|
||||||
c.foo1(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
c.foo1(null).length
|
||||||
c.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
c.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
||||||
c.foo3(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
c.foo3(null).length
|
||||||
c.bar1(null)<!UNSAFE_CALL!>.<!>length
|
c.bar1(null)<!UNSAFE_CALL!>.<!>length
|
||||||
c.bar1(null)?.length
|
c.bar1(null)?.length
|
||||||
c.bar2(null)<!UNSAFE_CALL!>.<!>length
|
c.bar2(null)<!UNSAFE_CALL!>.<!>length
|
||||||
|
|||||||
+16
-16
@@ -126,17 +126,17 @@ public class A {
|
|||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(a: A, b: A.B, c: A.C) {
|
fun main(a: A, b: A.B, c: A.C) {
|
||||||
a.foo("", null)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
a.foo("", null)?.length
|
||||||
a.foo("", null).length
|
a.foo("", null).length
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
a.foo(null, "").length
|
||||||
|
|
||||||
a.foobar(null, "")<!UNSAFE_CALL!>.<!>length
|
a.foobar(null, "").length
|
||||||
a.foobar("", <!NULL_FOR_NONNULL_TYPE!>null<!>)?.length
|
a.foobar("", <!NULL_FOR_NONNULL_TYPE!>null<!>)?.length
|
||||||
|
|
||||||
a.bar().length
|
a.bar().length
|
||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()!!.length
|
||||||
|
|
||||||
a.field<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
a.field?.length
|
||||||
a.field.length
|
a.field.length
|
||||||
|
|
||||||
a.baz()<!UNSAFE_CALL!>.<!>get(0)
|
a.baz()<!UNSAFE_CALL!>.<!>get(0)
|
||||||
@@ -145,35 +145,35 @@ fun main(a: A, b: A.B, c: A.C) {
|
|||||||
|
|
||||||
// b
|
// b
|
||||||
b.foo("", <!NULL_FOR_NONNULL_TYPE!>null<!>)?.length
|
b.foo("", <!NULL_FOR_NONNULL_TYPE!>null<!>)?.length
|
||||||
b.foo("", <!NULL_FOR_NONNULL_TYPE!>null<!>)<!UNSAFE_CALL!>.<!>length
|
b.foo("", <!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
||||||
b.foo(null, "")<!UNSAFE_CALL!>.<!>length
|
b.foo(null, "").length
|
||||||
|
|
||||||
b.foobar(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
b.foobar(null, "").length
|
||||||
b.foobar("", null)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
b.foobar("", null)?.length
|
||||||
|
|
||||||
b.bar()<!UNSAFE_CALL!>.<!>length
|
b.bar().length
|
||||||
b.bar()!!.length
|
b.bar()!!.length
|
||||||
|
|
||||||
b.field?.length
|
b.field?.length
|
||||||
b.field<!UNSAFE_CALL!>.<!>length
|
b.field.length
|
||||||
|
|
||||||
b.baz()<!UNSAFE_CALL!>.<!>get(0)
|
b.baz()<!UNSAFE_CALL!>.<!>get(0)
|
||||||
b.baz()!!.get(0).get(0)
|
b.baz()!!.get(0).get(0)
|
||||||
b.baz()!!.get(0)?.get(0)
|
b.baz()!!.get(0)?.get(0)
|
||||||
|
|
||||||
// c
|
// c
|
||||||
c.foo("", null)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
c.foo("", null)?.length
|
||||||
c.foo("", null).length
|
c.foo("", null).length
|
||||||
c.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
c.foo(null, "").length
|
||||||
|
|
||||||
c.foobar(null, "")<!UNSAFE_CALL!>.<!>length
|
c.foobar(null, "").length
|
||||||
c.foobar("", null)?.length
|
c.foobar("", null)?.length
|
||||||
|
|
||||||
c.bar().length
|
c.bar().length
|
||||||
c.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
c.bar()!!.length
|
||||||
|
|
||||||
c.field?.length
|
c.field?.length
|
||||||
c.field<!UNSAFE_CALL!>.<!>length
|
c.field.length
|
||||||
|
|
||||||
c.baz()<!UNSAFE_CALL!>.<!>get(0)
|
c.baz()<!UNSAFE_CALL!>.<!>get(0)
|
||||||
c.baz()!!.get(0).get(0)
|
c.baz()!!.get(0).get(0)
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ fun main(a: A) {
|
|||||||
// foo is platform
|
// foo is platform
|
||||||
a.foo("", "", null)?.length
|
a.foo("", "", null)?.length
|
||||||
a.foo("", "", null).length
|
a.foo("", "", null).length
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, <!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
a.foo(null, <!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
||||||
|
|
||||||
a.bar().length
|
a.bar().length
|
||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||||
|
|||||||
+1
-1
@@ -48,7 +48,7 @@ import test2.A2
|
|||||||
fun main(a: A, a2: A2) {
|
fun main(a: A, a2: A2) {
|
||||||
a.foo("", "", null)?.length
|
a.foo("", "", null)?.length
|
||||||
a.foo("", "", null).length
|
a.foo("", "", null).length
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, <!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
a.foo(null, <!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
||||||
|
|
||||||
a.bar().length
|
a.bar().length
|
||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||||
|
|||||||
+4
-4
@@ -63,17 +63,17 @@ public class A {
|
|||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(a: A) {
|
fun main(a: A) {
|
||||||
a.foo("", null)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
a.foo("", null)?.length
|
||||||
a.foo("", null).length
|
a.foo("", null).length
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
a.foo(null, "").length
|
||||||
|
|
||||||
a.bar().length
|
a.bar().length
|
||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()!!.length
|
||||||
|
|
||||||
a.field?.length
|
a.field?.length
|
||||||
a.field.length
|
a.field.length
|
||||||
|
|
||||||
a.baz()<!UNSAFE_CALL!>.<!>get(0)
|
a.baz().get(0)
|
||||||
a.baz()!!.get(0).get(0)
|
a.baz()!!.get(0).get(0)
|
||||||
a.baz()!!.get(0)?.get(0)
|
a.baz()!!.get(0)?.get(0)
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -68,17 +68,17 @@ public class A {
|
|||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(a: test.A) {
|
fun main(a: test.A) {
|
||||||
a.foo("", null)<!UNNECESSARY_SAFE_CALL!>?.<!>length
|
a.foo("", null)?.length
|
||||||
a.foo("", null).length
|
a.foo("", null).length
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
a.foo(null, "").length
|
||||||
|
|
||||||
a.bar().length
|
a.bar().length
|
||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()!!.length
|
||||||
|
|
||||||
a.field?.length
|
a.field?.length
|
||||||
a.field.length
|
a.field.length
|
||||||
|
|
||||||
a.baz()<!UNSAFE_CALL!>.<!>get(0)
|
a.baz().get(0)
|
||||||
a.baz()!!.get(0).get(0)
|
a.baz()!!.get(0).get(0)
|
||||||
a.baz()!!.get(0)?.get(0)
|
a.baz()!!.get(0)?.get(0)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -72,11 +72,11 @@ fun main(a: A) {
|
|||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
||||||
|
|
||||||
a.foo2("")
|
a.foo2("")
|
||||||
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
a.foo2(null)
|
||||||
|
|
||||||
a.foo3("")
|
a.foo3("")
|
||||||
a.foo3(null)
|
a.foo3(null)
|
||||||
|
|
||||||
a.foo4("")
|
a.foo4("")
|
||||||
a.foo4(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
a.foo4(null)
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -45,10 +45,10 @@ fun main(a: A) {
|
|||||||
|
|
||||||
a.foo2("", null)?.length
|
a.foo2("", null)?.length
|
||||||
a.foo2("", null).length
|
a.foo2("", null).length
|
||||||
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
a.foo2(null, "").length
|
||||||
|
|
||||||
a.bar2().length
|
a.bar2().length
|
||||||
a.bar2()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar2()!!.length
|
||||||
|
|
||||||
a.field2?.length
|
a.field2?.length
|
||||||
a.field2.length
|
a.field2.length
|
||||||
|
|||||||
+2
-2
@@ -45,10 +45,10 @@ fun main(a: A) {
|
|||||||
|
|
||||||
a.foo2("", null)?.length
|
a.foo2("", null)?.length
|
||||||
a.foo2("", null)<!UNSAFE_CALL!>.<!>length
|
a.foo2("", null)<!UNSAFE_CALL!>.<!>length
|
||||||
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
|
a.foo2(null, "")<!UNSAFE_CALL!>.<!>length
|
||||||
|
|
||||||
a.bar2().length
|
a.bar2().length
|
||||||
a.bar2()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar2()!!.length
|
||||||
|
|
||||||
a.field2?.length
|
a.field2?.length
|
||||||
a.field2<!UNSAFE_CALL!>.<!>length
|
a.field2<!UNSAFE_CALL!>.<!>length
|
||||||
|
|||||||
+3
-3
@@ -62,14 +62,14 @@ fun main(a: A) {
|
|||||||
a.field<!UNSAFE_CALL!>.<!>length
|
a.field<!UNSAFE_CALL!>.<!>length
|
||||||
|
|
||||||
a.foo2("", null)?.length
|
a.foo2("", null)?.length
|
||||||
a.foo2("", null)<!UNSAFE_CALL!>.<!>length
|
a.foo2("", null).length
|
||||||
a.foo2(null, "")<!UNSAFE_CALL!>.<!>length
|
a.foo2(null, "").length
|
||||||
|
|
||||||
a.bar2().length
|
a.bar2().length
|
||||||
a.bar2()!!.length
|
a.bar2()!!.length
|
||||||
|
|
||||||
a.field2?.length
|
a.field2?.length
|
||||||
a.field2<!UNSAFE_CALL!>.<!>length
|
a.field2.length
|
||||||
|
|
||||||
a.field3?.length
|
a.field3?.length
|
||||||
a.field3<!UNSAFE_CALL!>.<!>length
|
a.field3<!UNSAFE_CALL!>.<!>length
|
||||||
|
|||||||
+3
-3
@@ -44,12 +44,12 @@ fun main(a: A) {
|
|||||||
a.field.length
|
a.field.length
|
||||||
|
|
||||||
a.foo2("", null)?.length
|
a.foo2("", null)?.length
|
||||||
a.foo2("", null)<!UNSAFE_CALL!>.<!>length
|
a.foo2("", null).length
|
||||||
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
|
a.foo2(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
||||||
|
|
||||||
a.bar2().length
|
a.bar2().length
|
||||||
a.bar2()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar2()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
||||||
|
|
||||||
a.field2?.length
|
a.field2?.length
|
||||||
a.field2<!UNSAFE_CALL!>.<!>length
|
a.field2.length
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -35,10 +35,10 @@ public class A {
|
|||||||
fun main(a: A) {
|
fun main(a: A) {
|
||||||
a.foo("", null)?.length
|
a.foo("", null)?.length
|
||||||
a.foo("", null)<!UNSAFE_CALL!>.<!>length
|
a.foo("", null)<!UNSAFE_CALL!>.<!>length
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
|
a.foo(null, "")<!UNSAFE_CALL!>.<!>length
|
||||||
|
|
||||||
a.bar().length
|
a.bar().length
|
||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()!!.length
|
||||||
|
|
||||||
a.field?.length
|
a.field?.length
|
||||||
a.field<!UNSAFE_CALL!>.<!>length
|
a.field<!UNSAFE_CALL!>.<!>length
|
||||||
|
|||||||
+2
-2
@@ -66,7 +66,7 @@ fun main(b: B, c: C) {
|
|||||||
b.foo2()?.length
|
b.foo2()?.length
|
||||||
b.foo3()<!UNSAFE_CALL!>.<!>length
|
b.foo3()<!UNSAFE_CALL!>.<!>length
|
||||||
b.foo3()?.length
|
b.foo3()?.length
|
||||||
b.foo4()<!UNSAFE_CALL!>.<!>length
|
b.foo4().length
|
||||||
b.foo4()?.length
|
b.foo4()?.length
|
||||||
|
|
||||||
b.bar(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
b.bar(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
||||||
@@ -75,7 +75,7 @@ fun main(b: B, c: C) {
|
|||||||
b.bar2("")
|
b.bar2("")
|
||||||
b.bar3(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
b.bar3(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
||||||
b.bar3("")
|
b.bar3("")
|
||||||
b.bar4(<!NULL_FOR_NONNULL_TYPE!>null<!>)
|
b.bar4(null)
|
||||||
b.bar4("")
|
b.bar4("")
|
||||||
|
|
||||||
c.foo4()<!UNSAFE_CALL!>.<!>length
|
c.foo4()<!UNSAFE_CALL!>.<!>length
|
||||||
|
|||||||
+35
@@ -0,0 +1,35 @@
|
|||||||
|
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||||
|
// JSR305_GLOBAL_REPORT: ignore
|
||||||
|
// JSR305_MIGRATION_REPORT: ignore
|
||||||
|
// JSR305_SPECIAL_REPORT: MyNonnull:warn, MyMigrationNonnull:strict
|
||||||
|
|
||||||
|
// FILE: A.java
|
||||||
|
import javax.annotation.*;
|
||||||
|
|
||||||
|
public class A {
|
||||||
|
@MyMigrationNullable public String field = null;
|
||||||
|
|
||||||
|
@MyMigrationNullable
|
||||||
|
public String foo(@MyMigrationNonnull String x, CharSequence y) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
@MyNonnull
|
||||||
|
@MyMigrationNonnull
|
||||||
|
public String bar() {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
fun main(a: A) {
|
||||||
|
a.foo("", null)?.length
|
||||||
|
a.foo("", null).length
|
||||||
|
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "").length
|
||||||
|
|
||||||
|
a.bar().length
|
||||||
|
a.bar()!!.length
|
||||||
|
|
||||||
|
a.field?.length
|
||||||
|
a.field.length
|
||||||
|
}
|
||||||
-1
@@ -1,4 +1,3 @@
|
|||||||
// FIR_IDENTICAL
|
|
||||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||||
// JSR305_GLOBAL_REPORT: ignore
|
// JSR305_GLOBAL_REPORT: ignore
|
||||||
// JSR305_MIGRATION_REPORT: ignore
|
// JSR305_MIGRATION_REPORT: ignore
|
||||||
|
|||||||
+4
-4
@@ -34,14 +34,14 @@ public class A {
|
|||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(a: A) {
|
fun main(a: A) {
|
||||||
a.foo("", null)?.length
|
a.foo("", null)?.length
|
||||||
a.foo("", null)<!UNSAFE_CALL!>.<!>length
|
a.foo("", null).length
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
|
a.foo(null, "").length
|
||||||
|
|
||||||
a.bar().length
|
a.bar().length
|
||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()!!.length
|
||||||
|
|
||||||
a.field?.length
|
a.field?.length
|
||||||
a.field<!UNSAFE_CALL!>.<!>length
|
a.field.length
|
||||||
|
|
||||||
a.foo2("", null)?.length
|
a.foo2("", null)?.length
|
||||||
a.foo2("", null).length
|
a.foo2("", null).length
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
// MUTE_FOR_PSI_CLASS_FILES_READING
|
|
||||||
|
|
||||||
// FILE: J1.java
|
|
||||||
import io.reactivex.rxjava3.annotations.*;
|
|
||||||
|
|
||||||
public class J1<@NonNull T> {}
|
|
||||||
|
|
||||||
// FILE: main.kt
|
|
||||||
fun main() {
|
|
||||||
J1<<!UPPER_BOUND_VIOLATED!>Any?<!>>() // violated nullability, no warnings; but there is an error with -Xtype-enhancement-improvements-strict-mode
|
|
||||||
}
|
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
// FIR_IDENTICAL
|
||||||
// MUTE_FOR_PSI_CLASS_FILES_READING
|
// MUTE_FOR_PSI_CLASS_FILES_READING
|
||||||
|
|
||||||
// FILE: J1.java
|
// FILE: J1.java
|
||||||
|
|||||||
+7
-7
@@ -102,21 +102,21 @@ fun main1(a: A1<String>, a1: A1<String?>) {
|
|||||||
|
|
||||||
fun main2(a: A2<String>, a1: A2<String?>) {
|
fun main2(a: A2<String>, a1: A2<String?>) {
|
||||||
a.foo("", null)?.length
|
a.foo("", null)?.length
|
||||||
a.foo("", null)<!UNSAFE_CALL!>.<!>length
|
a.foo("", null).length
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
|
a.foo(null, "").length
|
||||||
|
|
||||||
a.bar().length
|
a.bar().length
|
||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()!!.length
|
||||||
|
|
||||||
a.field?.length
|
a.field?.length
|
||||||
a.field<!UNSAFE_CALL!>.<!>length
|
a.field.length
|
||||||
|
|
||||||
a.baz("")<!UNSAFE_CALL!>.<!>length
|
a.baz("").length
|
||||||
a.baz("")?.length
|
a.baz("")?.length
|
||||||
a.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)<!UNSAFE_CALL!>.<!>length
|
a.baz(null).length
|
||||||
|
|
||||||
a1.baz("")!!.length
|
a1.baz("")!!.length
|
||||||
a1.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)!!.length
|
a1.baz(null)!!.length
|
||||||
}
|
}
|
||||||
|
|
||||||
fun main3(a: A3<String>, a1: A3<String?>) {
|
fun main3(a: A3<String>, a1: A3<String?>) {
|
||||||
|
|||||||
+7
-7
@@ -23,19 +23,19 @@ public class A<T> {
|
|||||||
|
|
||||||
fun main(a: A<String>, a1: A<String?>) {
|
fun main(a: A<String>, a1: A<String?>) {
|
||||||
a.foo("", null)?.length
|
a.foo("", null)?.length
|
||||||
a.foo("", null)<!UNSAFE_CALL!>.<!>length
|
a.foo("", null).length
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
|
a.foo(null, "").length
|
||||||
|
|
||||||
a.bar().length
|
a.bar().length
|
||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()!!.length
|
||||||
|
|
||||||
a.field?.length
|
a.field?.length
|
||||||
a.field<!UNSAFE_CALL!>.<!>length
|
a.field.length
|
||||||
|
|
||||||
a.baz("")<!UNSAFE_CALL!>.<!>length
|
a.baz("").length
|
||||||
a.baz("")?.length
|
a.baz("")?.length
|
||||||
a.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)<!UNSAFE_CALL!>.<!>length
|
a.baz(null).length
|
||||||
|
|
||||||
a1.baz("")!!.length
|
a1.baz("")!!.length
|
||||||
a1.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)!!.length
|
a1.baz(null)!!.length
|
||||||
}
|
}
|
||||||
|
|||||||
+7
-7
@@ -25,19 +25,19 @@ public class A<T> {
|
|||||||
|
|
||||||
fun main(a: A<String>, a1: A<String?>) {
|
fun main(a: A<String>, a1: A<String?>) {
|
||||||
a.foo("", null)?.length
|
a.foo("", null)?.length
|
||||||
a.foo("", null)<!UNSAFE_CALL!>.<!>length
|
a.foo("", null).length
|
||||||
a.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>, "")<!UNSAFE_CALL!>.<!>length
|
a.foo(null, "").length
|
||||||
|
|
||||||
a.bar().length
|
a.bar().length
|
||||||
a.bar()<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>.length
|
a.bar()!!.length
|
||||||
|
|
||||||
a.field?.length
|
a.field?.length
|
||||||
a.field<!UNSAFE_CALL!>.<!>length
|
a.field.length
|
||||||
|
|
||||||
a.baz("")<!UNSAFE_CALL!>.<!>length
|
a.baz("").length
|
||||||
a.baz("")?.length
|
a.baz("")?.length
|
||||||
a.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)<!UNSAFE_CALL!>.<!>length
|
a.baz(null).length
|
||||||
|
|
||||||
a1.baz("")!!.length
|
a1.baz("")!!.length
|
||||||
a1.baz(<!NULL_FOR_NONNULL_TYPE!>null<!>)!!.length
|
a1.baz(null)!!.length
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -56,7 +56,7 @@ public class PolicyFromNickname {
|
|||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main(default: PolicyFromDefault, nickname: PolicyFromNickname) {
|
fun main(default: PolicyFromDefault, nickname: PolicyFromNickname) {
|
||||||
default.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
default.foo(null).length
|
||||||
default.foo("hello").length
|
default.foo("hello").length
|
||||||
|
|
||||||
nickname.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
nickname.foo(<!NULL_FOR_NONNULL_TYPE!>null<!>).length
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
public abstract interface TypeParamOfClass : R|kotlin/Any| {
|
public abstract interface TypeParamOfClass : R|kotlin/Any| {
|
||||||
public abstract interface Sub<T : R|ft<kotlin/Any, kotlin/Any?>|> : R|test/TypeParamOfClass.Super<ft<T, T?>>| {
|
public abstract interface Sub<T : R|ft<kotlin/Any, kotlin/Any?>|> : R|test/TypeParamOfClass.Super<ft<T, T?>>| {
|
||||||
public abstract fun foo(): R|@EnhancedNullability T|
|
public abstract fun foo(): R|@EnhancedNullability T & Any|
|
||||||
|
|
||||||
}
|
}
|
||||||
public abstract interface Super<T : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
|
public abstract interface Super<T : R|ft<kotlin/Any, kotlin/Any?>|> : R|kotlin/Any| {
|
||||||
|
|||||||
Reference in New Issue
Block a user