11import csharp
2- import semmle.code.csharp.commons.QualifiedName
32
43private string getLocation ( Member m ) {
54 if m .fromSource ( ) then result = m .getALocation ( ) .( SourceLocation ) .toString ( ) else result = "-"
@@ -9,13 +8,9 @@ private string getIsAsync(ForeachStmt f) {
98 if f .isAsync ( ) then result = "async" else result = "sync"
109}
1110
12- from
13- ForeachStmt f , string qualifier1 , string type1 , string qualifier2 , string type2 ,
14- string qualifier3 , string type3
15- where
16- f .getGetEnumerator ( ) .getDeclaringType ( ) .hasFullyQualifiedName ( qualifier1 , type1 ) and
17- f .getCurrent ( ) .getDeclaringType ( ) .hasFullyQualifiedName ( qualifier2 , type2 ) and
18- f .getMoveNext ( ) .getDeclaringType ( ) .hasFullyQualifiedName ( qualifier3 , type3 )
19- select f , f .getElementType ( ) .toString ( ) , getIsAsync ( f ) , getQualifiedName ( qualifier1 , type1 ) ,
20- getLocation ( f .getGetEnumerator ( ) ) , getQualifiedName ( qualifier2 , type2 ) ,
21- getLocation ( f .getCurrent ( ) ) , getQualifiedName ( qualifier3 , type3 ) , getLocation ( f .getMoveNext ( ) )
11+ from ForeachStmt f
12+ select f , f .getElementType ( ) .toString ( ) , getIsAsync ( f ) ,
13+ f .getGetEnumerator ( ) .getDeclaringType ( ) .getFullyQualifiedNameDebug ( ) ,
14+ getLocation ( f .getGetEnumerator ( ) ) , f .getCurrent ( ) .getDeclaringType ( ) .getFullyQualifiedNameDebug ( ) ,
15+ getLocation ( f .getCurrent ( ) ) , f .getMoveNext ( ) .getDeclaringType ( ) .getFullyQualifiedNameDebug ( ) ,
16+ getLocation ( f .getMoveNext ( ) )
0 commit comments