arekolek
02/13/2019, 1:47 PMandroid.annotations.Nullable
generate a mere warning instead of an error?Jay
02/13/2019, 2:11 PMgumil
02/13/2019, 2:12 PMString!
which can be of type String
or String?
arekolek
02/13/2019, 2:21 PMarekolek
02/13/2019, 2:21 PMarekolek
02/13/2019, 2:21 PMarekolek
02/13/2019, 2:21 PMimport androidx.annotation.Nullable;
public class Test {
@Nullable
public String getAction() {
throw new RuntimeException();
}
}
arekolek
02/13/2019, 2:23 PMandroidx.annotation.Nullable
annotation but not the android.annotation.Nullable
arekolek
02/13/2019, 2:24 PMjw
02/13/2019, 2:38 PMandroid.annotation.Nullable
. It rewrites the bytecode to use android.annotation.RecentlyNullable
which only triggers a warning. It will be an error in Q.arekolek
02/13/2019, 3:03 PMNormally, nullability contract violations in Kotlin result in compilation errors. But to ensure the newly annotated APIs are compatible with your existing code, we are using an internal mechanism provided by the Kotlin compiler team to mark the APIs as recently annotated. […] The goal is to provide you with sufficient time to update your code.