mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-24 02:21:30 -05:00
Fix/dependent parameters obj methods (#48110)
* Add failing test for dependent destructured variables within obj methods * Fixed an issue with dependent parameters within obj methods
This commit is contained in:
committed by
GitHub
parent
5fd0b6432e
commit
04238e6f52
@@ -24471,7 +24471,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getCandidateDiscriminantPropertyAccess(expr: Expression) {
|
||||
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference)) {
|
||||
if (isBindingPattern(reference) || isFunctionExpressionOrArrowFunction(reference) || isObjectLiteralMethod(reference)) {
|
||||
// When the reference is a binding pattern or function or arrow expression, we are narrowing a pesudo-reference in
|
||||
// getNarrowedTypeOfSymbol. An identifier for a destructuring variable declared in the same binding pattern or
|
||||
// parameter declared in the same parameter list is a candidate.
|
||||
|
||||
Reference in New Issue
Block a user