mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Simplify compilation of array indexing in SpEL's Indexer
This commit is contained in:
+12
@@ -652,6 +652,18 @@ public class SpelCompilationCoverageTests extends AbstractExpressionTests {
|
||||
assertThat(getAst().getExitDescriptor()).isEqualTo("I");
|
||||
}
|
||||
|
||||
@Test
|
||||
void indexIntoSetCannotBeCompiled() {
|
||||
Set<Integer> set = Set.of(42);
|
||||
|
||||
expression = parser.parseExpression("[0]");
|
||||
|
||||
assertThat(expression.getValue(set)).isEqualTo(42);
|
||||
assertCannotCompile(expression);
|
||||
assertThat(expression.getValue(set)).isEqualTo(42);
|
||||
assertThat(getAst().getExitDescriptor()).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
void indexIntoStringCannotBeCompiled() {
|
||||
String text = "enigma";
|
||||
|
||||
Reference in New Issue
Block a user