Skip to content

Commit eae42e6

Browse files
committed
Unified: Add Callable.getReturnType
1 parent dc7b9bd commit eae42e6

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎unified/extractor/ast_types.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ supertypes:
7979
fields:
8080
parameter*: parameter
8181
body?: block
82+
return_type?: expr
8283
# A member is anything that can appear in the body of a class-like declaration
8384
member:
8485
subtypes:

‎unified/ql/lib/codeql/unified/internal/Ast.qll‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ module Unified {
369369

370370
/** Gets the node corresponding to the field `parameter`. */
371371
F::Parameter getAParameter() { none() }
372+
373+
/** Gets the node corresponding to the field `return_type`. */
374+
F::Expr getReturnType() { none() }
372375
}
373376

374377
/** A class representing `catch_clause` nodes. */
@@ -721,7 +724,9 @@ module Unified {
721724
final override F::Parameter getAParameter() { result = this.getParameter(_) }
722725

723726
/** Gets the node corresponding to the field `return_type`. */
724-
final F::Expr getReturnType() { unified_function_declaration_return_type(this, result) }
727+
final override F::Expr getReturnType() {
728+
unified_function_declaration_return_type(this, result)
729+
}
725730

726731
/** Gets the node corresponding to the field `type_constraint`. */
727732
final F::TypeConstraint getTypeConstraint(int i) {
@@ -782,7 +787,7 @@ module Unified {
782787
final override F::Parameter getAParameter() { result = this.getParameter(_) }
783788

784789
/** Gets the node corresponding to the field `return_type`. */
785-
final F::Expr getReturnType() { unified_function_expr_return_type(this, result) }
790+
final override F::Expr getReturnType() { unified_function_expr_return_type(this, result) }
786791

787792
/** Gets a field or child node of this node. */
788793
final override F::AstNode getAFieldOrChild() {

0 commit comments

Comments
 (0)