C#: Add test for length argument of implicitly sized arrays

This commit is contained in:
Tamas Vajk
2020-08-18 11:44:24 +02:00
parent 9decb47bf0
commit 99e62ceee6
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
| expressions.cs:168:27:168:44 | array creation of type Object[] | expressions.cs:168:27:168:44 | 1 | false |
| expressions.cs:409:23:409:65 | array creation of type Int32[,] | expressions.cs:409:23:409:65 | 3 | false |
| expressions.cs:409:23:409:65 | array creation of type Int32[,] | expressions.cs:409:23:409:65 | 3 | false |

View File

@@ -0,0 +1,13 @@
/**
* @name Test for array creations
*/
import csharp
private boolean isImplicit(Expr expr) {
if expr.isImplicit() then result = true else result = false
}
from ArrayCreation ac, Expr expr
where ac.isImplicitlySized() and not ac.isImplicitlyTyped() and expr = ac.getALengthArgument()
select ac, expr, isImplicit(expr)