Generate not-null assertions on method parameters
Intrinsics.checkParameterIsNotNull() gets its caller's class and method names from the stack trace to render them in an exception message. Fix codegen tests because now it's now allowed to pass null to non-null argument in tests
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public abstract class doGenerateParamAssertions {
|
||||
|
||||
public abstract void bar(@NotNull String s);
|
||||
|
||||
public static String foo(doGenerateParamAssertions a) {
|
||||
try {
|
||||
a.bar(null);
|
||||
} catch (IllegalArgumentException e) {
|
||||
return "OK";
|
||||
}
|
||||
return "Fail: AssertionError expected";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user