mp
10/25/2019, 6:41 PM@Nullable
for a method that returns a nullable type, etc, so that in plain Java code the IDE can provide the same suggestions that it would for a @Nullable
Java method?Ilmir Usmanov [JB]
10/25/2019, 7:14 PM$ echo "fun foo(): String? = null" > 1.kt
$ kotlinc 1.kt
$ javap -v _1Kt.class
yields:
...
#7 = Utf8 Lorg/jetbrains/annotations/Nullable;
...
{
public static final java.lang.String foo();
descriptor: ()Ljava/lang/String;
flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL
Code:
stack=1, locals=0, args_size=0
0: aconst_null
1: areturn
LineNumberTable:
line 1: 0
RuntimeInvisibleAnnotations:
0: #7()
}
...
mp
11/12/2019, 2:26 AM@Nullable
. Is that expected, or should we perhaps try to package that up into a self contained repro?Ilmir Usmanov [JB]
11/12/2019, 1:10 PMmp
11/12/2019, 1:21 PMmp
12/05/2019, 6:32 PM?
type, it's fine to inject null, but Guice will barf unless you annotate with @Nullable
that's available at runtime. However, the emitted annotations have @Retention(RetentionPolicy.CLASS)
. Is there a way to emit ones that use RUNTIME?