File tree Expand file tree Collapse file tree 2 files changed +14
-5
lines changed
framework-docs/modules/ROOT/pages/core/expressions Expand file tree Collapse file tree 2 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -518,6 +518,7 @@ following kinds of expressions cannot be compiled.
518
518
* Expressions relying on the conversion service
519
519
* Expressions using custom resolvers or accessors
520
520
* Expressions using overloaded operators
521
+ * Expressions using array construction syntax
521
522
* Expressions using selection or projection
522
523
523
524
Compilation of additional kinds of expressions may be supported in the future.
Original file line number Diff line number Diff line change 13
13
int[] numbers1 = (int[]) parser.parseExpression("new int[4]").getValue(context);
14
14
15
15
// Array with initializer
16
- int[] numbers2 = (int[]) parser.parseExpression("new int[]{1,2, 3}").getValue(context);
16
+ int[] numbers2 = (int[]) parser.parseExpression("new int[] {1, 2, 3}").getValue(context);
17
17
18
18
// Multi dimensional array
19
19
int[][] numbers3 = (int[][]) parser.parseExpression("new int[4][5]").getValue(context);
@@ -26,14 +26,22 @@ Kotlin::
26
26
val numbers1 = parser.parseExpression("new int[4]").getValue(context) as IntArray
27
27
28
28
// Array with initializer
29
- val numbers2 = parser.parseExpression("new int[]{1,2, 3}").getValue(context) as IntArray
29
+ val numbers2 = parser.parseExpression("new int[] {1, 2, 3}").getValue(context) as IntArray
30
30
31
31
// Multi dimensional array
32
32
val numbers3 = parser.parseExpression("new int[4][5]").getValue(context) as Array<IntArray>
33
33
----
34
34
======
35
35
36
+ [NOTE]
37
+ ====
36
38
You cannot currently supply an initializer when you construct a multi-dimensional array.
37
-
38
-
39
-
39
+ ====
40
+
41
+ [CAUTION]
42
+ ====
43
+ Any expression that constructs an array – for example, via `new int[4]` or
44
+ `new int[] {1, 2, 3}` – cannot be compiled. See
45
+ xref:core/expressions/evaluation.adoc#expressions-compiler-limitations[Compiler Limitations]
46
+ for details.
47
+ ====
You can’t perform that action at this time.
0 commit comments