mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
C# extractor: Handle the type name of dynamic.
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 |
|
||||
|
||||
Reference in New Issue
Block a user