K2: swap heuristics in AnnotationLoader (related to KT-62598)
Before this commit, we first tried to guess a type of array literal in deserialized annotation (it's a strange heuristics which can lead to SOE and maybe not needed at all, see KT-62598, KT-62929), and then, if unsuccessful, took the type from the first literal element, if any. Since the second heuristic is much more clear, safe, and understandable, in this commit they were swapped. This commit does not fix KT-62598 in general case, but decreases a set of cases when it can occur to empty array literals only. See the commented line at the end of the added test.
This commit is contained in:
committed by
Space Team
parent
4720a0faa7
commit
19a95f2fb4
+5
@@ -16030,6 +16030,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
||||
runTest("compiler/testData/codegen/box/fir/SamWithReceiverMavenProjectImportHandler.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("StackOverflowInAnnotationLoader.kt")
|
||||
public void testStackOverflowInAnnotationLoader() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/StackOverflowInAnnotationLoader.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("staticImportFromEnum.kt")
|
||||
public void testStaticImportFromEnum() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/fir/staticImportFromEnum.kt");
|
||||
|
||||
Reference in New Issue
Block a user