We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b39ef15 commit 97dc494Copy full SHA for 97dc494
javascript/ql/lib/semmle/javascript/internal/TypeResolution.qll
@@ -129,6 +129,13 @@ module TypeResolution {
129
predicate valueHasType(Node value, Node type) {
130
value.(BindingPattern).getTypeAnnotation() = type
131
or
132
+ exists(VarDecl decl |
133
+ // ValueFlow::step is restricted to variables with at most one assignment. Allow the type annotation
134
+ // of a variable to propagate to its uses, even if the variable has multiple assignments.
135
+ type = decl.getTypeAnnotation() and
136
+ value = decl.getVariable().(LocalVariable).getAnAccess()
137
+ )
138
+ or
139
exists(MemberDeclaration member |
140
value.(ThisExpr).getBindingContainer() = member.getInit() and
141
type = getMemberBase(member)
0 commit comments