mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 00:21:47 +00:00
If a method comes from Java and is annotated as returning NotNull, after calling it we should check if it actually returned something other than null. Introduce checkReturnedValueIsNotNull() in jet/runtime/Intrinsics which does exactly that. CallableMethod's invoke() and invokeDefault() are now private, use asserted versions instead
29 lines
580 B
Java
29 lines
580 B
Java
import jet.runtime.typeinfo.KotlinSignature;
|
|
|
|
public class A {
|
|
@KotlinSignature("fun foo() : String")
|
|
public String foo() {
|
|
return null;
|
|
}
|
|
|
|
@KotlinSignature("fun staticFoo() : String")
|
|
public static String staticFoo() {
|
|
return null;
|
|
}
|
|
|
|
@KotlinSignature("fun plus(a: A) : A")
|
|
public A plus(A a) {
|
|
return null;
|
|
}
|
|
|
|
@KotlinSignature("fun inc() : A")
|
|
public A inc() {
|
|
return null;
|
|
}
|
|
|
|
@KotlinSignature("fun get(o: Any) : Any")
|
|
public Object get(Object o) {
|
|
return null;
|
|
}
|
|
}
|