C#: Extractor tests for

- While statements
- Object initializers
This commit is contained in:
calum
2018-09-05 16:18:53 +01:00
parent 727ab94c4e
commit 7a77740979
4 changed files with 38 additions and 0 deletions

View File

@@ -81,3 +81,28 @@ class Designations
return 0;
}
}
class WhileIs
{
void Test()
{
object x = null;
while(x is string s)
{
var y = s;
}
}
}
class ObjectInitializerType
{
struct Point
{
public object Name;
}
void F()
{
new Point() { Name = "Bob" };
}
}

View File

@@ -39,3 +39,10 @@
| Program.cs:69:5:69:8 | Boolean |
| Program.cs:69:16:69:18 | Int32 |
| Program.cs:75:5:75:7 | Int32 |
| Program.cs:87:5:87:8 | Void |
| Program.cs:89:9:89:14 | Object |
| Program.cs:90:20:90:25 | String |
| Program.cs:92:13:92:15 | String |
| Program.cs:101:16:101:21 | Object |
| Program.cs:104:5:104:8 | Void |
| Program.cs:106:13:106:17 | Point |

View File

@@ -0,0 +1 @@
| Program.cs:92:21:92:21 | access to local variable s |

View File

@@ -0,0 +1,5 @@
import csharp
from LocalVariable decl
where decl.getName() = "s"
select decl.getAnAccess()