Do not allow to assign null to a non-null property via reflection

This was already working for accessor-based properties because the assertions
were already generated into corresponding accessors, but for fields we must
manually check the value against null
This commit is contained in:
Alexander Udalov
2015-08-04 21:09:09 +03:00
parent 3091f2af3b
commit 49b689f883
4 changed files with 67 additions and 6 deletions
@@ -2844,6 +2844,12 @@ public class BlackBoxWithStdlibCodegenTestGenerated extends AbstractBlackBoxCode
doTestWithStdlib(fileName);
}
@TestMetadata("disallowNullValueForNotNullField.kt")
public void testDisallowNullValueForNotNullField() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/call/disallowNullValueForNotNullField.kt");
doTestWithStdlib(fileName);
}
@TestMetadata("equalsHashCodeToString.kt")
public void testEqualsHashCodeToString() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/boxWithStdlib/reflection/call/equalsHashCodeToString.kt");