From 1ae0dd46ec6eb6f72bfedba843f58b69619c986c Mon Sep 17 00:00:00 2001 From: Max Schaefer Date: Wed, 4 Mar 2020 12:53:37 +0000 Subject: [PATCH] Clarify method identity. --- ql/src/semmle/go/Scopes.qll | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ql/src/semmle/go/Scopes.qll b/ql/src/semmle/go/Scopes.qll index efe4871515f..f04c6fc685e 100644 --- a/ql/src/semmle/go/Scopes.qll +++ b/ql/src/semmle/go/Scopes.qll @@ -391,7 +391,13 @@ class Function extends ValueEntity, @functionobject { Parameter getAParameter() { result = getParameter(_) } } -/** A method, that is, a function with a receiver variable. */ +/** + * A method, that is, a function with a receiver variable, or a function declared in an interface. + * + * Note that method identity is determined by receiver type identity: if two methods have the same + * name and their receiver types are identical in the sense of the Go language specification + * (https://golang.org/ref/spec#Type_identity), then the two methods are identical as well. + */ class Method extends Function { Variable receiver;