From a92349683e1f32f02dd9ef2c2aaaac45023d77a9 Mon Sep 17 00:00:00 2001 From: Owen Mansel-Chan Date: Mon, 8 Jun 2026 23:18:37 +0200 Subject: [PATCH] Deprecate `FuncTypeExpr.getResultDecl()` It is unused in this library. It could easily be used incorrectly and silently omit results when `getNumResult() > 1`. --- go/ql/lib/semmle/go/Expr.qll | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/go/ql/lib/semmle/go/Expr.qll b/go/ql/lib/semmle/go/Expr.qll index 0d3955a80df..9a8481a2dcc 100644 --- a/go/ql/lib/semmle/go/Expr.qll +++ b/go/ql/lib/semmle/go/Expr.qll @@ -1067,11 +1067,11 @@ class FuncTypeExpr extends @functypeexpr, TypeExpr, ScopeNode, FieldParent { int getNumResult() { result = count(this.getAResultDecl().getANameExpr()) } /** - * Gets the result of this function type, if there is only one. - * - * Note: `x, y int` is a single `ResultVariableDecl`. + * DEPRECATED: Use `getResultDecl(int i)` instead. */ - ResultVariableDecl getResultDecl() { this.getNumResult() = 1 and result = this.getAResultDecl() } + deprecated ResultVariableDecl getResultDecl() { + this.getNumResult() = 1 and result = this.getAResultDecl() + } override string toString() { result = "function type" }