Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 15e8847

Browse files
committed
Adjust 'Cast.getTargetType()' to return the expression type instead of the type access type
1 parent a11d852 commit 15e8847

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • csharp/ql/src/semmle/code/csharp/exprs

csharp/ql/src/semmle/code/csharp/exprs/Expr.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ class Cast extends Expr {
617617
TypeAccess getTypeAccess() { result = this.getChild(1) }
618618

619619
/** Gets the type that the underlying expression is being cast to. */
620-
Type getTargetType() { result = this.getTypeAccess().getTarget() }
620+
Type getTargetType() { result = this.getType() }
621621

622622
/** Gets the type of the underlying expression. */
623623
Type getSourceType() { result = this.getExpr().getType() }

0 commit comments

Comments
 (0)