@@ -154,8 +154,8 @@ The `ConstExpression` attribute may only be attached to functions with the follo
154154 <tr>
155155 <td>bool</td>
156156 <td>enum</td>
157+ <td>null</td>
157158 <td>struct<br/>- No reference type instances as members</td>
158- <td></td>
159159 </tr>
160160 <tr>
161161 <td>ReadOnlyArray<string></td>
@@ -178,8 +178,8 @@ The `ConstExpression` attribute may only be attached to functions with the follo
178178 <tr>
179179 <td>ReadOnlyArray<bool></td>
180180 <td>ReadOnlyArray<enum></td>
181+ <td>ReadOnlyArray<null></td>
181182 <td>ReadOnlyArray<struct><br/>- No reference type instances as members</td>
182- <td></td>
183183 </tr>
184184 <tr>
185185 <td>ReadOnlyArray<ReadOnlyArray<...>></td>
@@ -236,6 +236,13 @@ int r = 200;
236236MyConstExpression.Add(l, r);
237237```
238238
239+ ### Disabling ConstExpression
240+ You can disable ConstExpression with the following notation.
241+ ``` .cs.
242+ [assembly:IgnoreConstExpression]
243+ ```
244+ This attribute can also be type or method specific.
245+
239246## How to Use StaticExpression
240247### Normal usage
241248#### Creating Assembly for StaticExpression
@@ -260,10 +267,10 @@ There are several limitations to performing runtime constant pre-computations.
260267#### StaticExpression属性
261268Only functions with the ` StaticExpression ` attribute are subject to runtime constant pre-computations
262269
263- #### static関数
270+ #### Static Function
264271The ` StaticExpression ` attribute can only be attached to static functions.
265272
266- #### 引数/戻り値
273+ #### Arguments/Return Values
267274The ` StaticExpression ` attribute can only be attached to functions with the following argument/return types.
268275Unlike ` ConstExpression ` , reflection types can be used.
269276 <table >
@@ -288,12 +295,12 @@ Unlike `ConstExpression`, reflection types can be used.
288295 <tr>
289296 <td>bool</td>
290297 <td>enum</td>
298+ <td>null</td>
291299 <td>struct<br/>- No reference type instances as members</td>
292- <td>Type</td>
293300 </tr>
294301 <tr>
295302 <td>MemberInfo</td>
296- <td>TypeInfo</td>
303+ <td>Type/ TypeInfo</td>
297304 <td>ConstructorInfo</td>
298305 <td>FieldInfo</td>
299306 </tr>
@@ -324,12 +331,12 @@ Unlike `ConstExpression`, reflection types can be used.
324331 <tr>
325332 <td>ReadOnlyArray<bool></td>
326333 <td>ReadOnlyArray<enum></td>
334+ <td>ReadOnlyArray<null></td>
327335 <td>ReadOnlyArray<struct><br/>- No reference type instances as members</td>
328- <td>ReadOnlyArray<Type></td>
329336 </tr>
330337 <tr>
331338 <td>ReadOnlyArray<MemberInfo></td>
332- <td>ReadOnlyArray<TypeInfo ></td>
339+ <td>ReadOnlyArray<Type/TypeInfo ></td>
333340 <td>ReadOnlyArray<ConstructorInfo></td>
334341 <td>ReadOnlyArray<FieldInfo></td>
335342 </tr>
@@ -389,7 +396,7 @@ MyStaticExpression.Add(MyStaticExpression.MakeVector2(10, 20), MyStaticExpressio
389396MyStaticExpression .Add (new Vector2 (10 , 20 ), new Vector2 (30 , 40 ));
390397```
391398
392- ##### CalculationFailedWarningオプション
399+ ##### CalculationFailedWarning option
393400Setting the ` ConstExpression ` attribute to ` CalculationFailedWarning=false ` will prevent the warning from occurring when assigning a non-constant value to an argument.
394401```
395402[StaticExpression(CalculationFailedWarning = false)]
@@ -402,7 +409,15 @@ public static int Add(int l, int r)
402409MyStaticExpression.Add(l, r);
403410```
404411
405- ### About ReadOnlyArray
412+ ### Disabling StaticExpression
413+ You can disable StaticExpression with the following notation.
414+ ``` .cs.
415+ [assembly:IgnoreStaticExpression]
416+ ```
417+ This attribute can also be type or method specific.
418+
419+
420+ ## About ReadOnlyArray
406421ReadOnlyArray is an immutable array prepared as a return constant for ConstExpression.
407422It inherits from IReadOnlyList and can be implicitly cast to ReadOnlySpan.
408423Implicit casts from arrays are also possible.
@@ -418,4 +433,4 @@ IReadOnlyList<byte> listBinary = binary;
418433
419434// NG
420435byte [] bytes = binary ;
421- ```
436+ ```
0 commit comments