Skip to content

Commit fe24710

Browse files
committed
Improve QLDoc of Entity.getDeclaration
1 parent c7f2e99 commit fe24710

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

go/ql/lib/semmle/go/Scopes.qll

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,13 @@ class Entity extends @object {
119119
*/
120120
Scope getScope() { objectscopes(this, result) }
121121

122-
/** Gets the declaring identifier for this entity. */
122+
/**
123+
* Gets the declaring identifier for this entity, if any.
124+
*
125+
* Note that type switch statements which define a new variable in the guard
126+
* actually have a new variable (of the right type) implicitly declared at
127+
* the beginning of each case clause, and these do not have a declaration.
128+
*/
123129
Ident getDeclaration() { result.declares(this) }
124130

125131
/** Gets a reference to this entity. */

0 commit comments

Comments
 (0)