We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92f2721 commit 72a1e85Copy full SHA for 72a1e85
src/compiler/checker.ts
@@ -17041,7 +17041,8 @@ namespace ts {
17041
// so we need to do a bit of extra work to check if reference is legal
17042
const enclosingContainer = getEnclosingBlockScopeContainer(symbol.valueDeclaration);
17043
if (enclosingContainer === func) {
17044
- if (symbol.valueDeclaration.kind === SyntaxKind.Parameter) {
+ if (symbol.valueDeclaration.kind === SyntaxKind.Parameter ||
17045
+ symbol.valueDeclaration.kind === SyntaxKind.BindingElement) {
17046
// it is ok to reference parameter in initializer if either
17047
// - parameter is located strictly on the left of current parameter declaration
17048
if (symbol.valueDeclaration.pos < node.pos) {
0 commit comments