C# extractor: Handle the type name of dynamic.

This commit is contained in:
calum
2018-10-31 13:42:46 +00:00
parent 185700a236
commit bb49fe170b
3 changed files with 23 additions and 0 deletions

View File

@@ -43,6 +43,7 @@ namespace Semmle.Extraction.CSharp.Entities.Expressions
{
case SymbolKind.TypeParameter:
case SymbolKind.NamedType:
case SymbolKind.DynamicType:
return TypeAccess.Create(info);
case SymbolKind.Property:

View File

@@ -119,3 +119,18 @@ class LiteralConversions
new Point { x=1, y=2 };
}
}
class DynamicType
{
void F()
{
dynamic t = (dynamic)null;
}
}
class LocalVariableTags
{
Func<int, int> F = x => { int y=x; return y; };
}
// semmle-extractor-options: /r:System.Dynamic.Runtime.dll

View File

@@ -52,3 +52,10 @@
| Program.cs:114:16:114:19 | Nullable<Int32> |
| Program.cs:117:5:117:8 | Void |
| Program.cs:119:13:119:17 | Point |
| Program.cs:125:5:125:8 | Void |
| Program.cs:127:9:127:15 | dynamic |
| Program.cs:127:22:127:28 | dynamic |
| Program.cs:133:5:133:8 | Func<Int32,Int32> |
| Program.cs:133:10:133:12 | Int32 |
| Program.cs:133:15:133:17 | Int32 |
| Program.cs:133:31:133:33 | Int32 |