mirror of
https://github.com/github/codeql.git
synced 2026-04-24 00:05:14 +02:00
C#: Anonymous types should not be considered unknown.
This commit is contained in:
@@ -31,10 +31,13 @@ namespace Semmle.Extraction.CSharp.Entities
|
||||
/// <param name="symbol">Type symbol</param>
|
||||
private bool IsBrokenType(ITypeSymbol symbol)
|
||||
{
|
||||
if (!Context.ExtractionContext.IsStandalone || !symbol.FromSource())
|
||||
if (!Context.ExtractionContext.IsStandalone ||
|
||||
!symbol.FromSource() ||
|
||||
symbol.IsAnonymousType)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// (1) public class { ... } is a broken type and doesn't have a name.
|
||||
// (2) public class var { ... } is a an allowed type, but it overrides the var keyword for all uses.
|
||||
// It is probably a better heuristic to treat it as a broken type.
|
||||
|
||||
Reference in New Issue
Block a user