Skip to content

Warning on type annotation for default values of destructuring parameters #1762

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
evmar opened this issue Apr 28, 2016 · 0 comments
Open

Comments

@evmar
Copy link
Contributor

evmar commented Apr 28, 2016

In the following code, the second function warns:

input0:10: WARNING - parameter param does not appear in foo2's parameter list
function foo2({x} = {}) {
^
/**
 * @param {!{x: number}} param
 */
function foo1({x}) {
}

/**
 * @param {!{x: number}} param
 */
function foo2({x} = {}) {
}

https://closure-compiler-debugger.appspot.com/#input0%3D%252F**%250A%2520*%2520%2540param%2520%257B!%257Bx%253A%2520number%257D%257D%2520param%250A%2520*%252F%250Afunction%2520foo1(%257Bx%257D)%2520%257B%250A%257D%250A%250A%252F**%250A%2520*%2520%2540param%2520%257B!%257Bx%253A%2520number%257D%257D%2520param%250A%2520*%252F%250Afunction%2520foo2(%257Bx%257D%2520%253D%2520%257B%257D)%2520%257B%250A%257D%250A%26input1%26conformanceConfig%26externs%26refasterjs-template%26includeDefaultExterns%3D1%26CHECK_SYMBOLS%3D1%26CHECK_TYPES%3D1%26LANG_IN_IS_ES6%3D1%26MISSING_PROPERTIES%3D1%26PRESERVE_TYPE_ANNOTATIONS%3D1%26PRETTY_PRINT%3D1%26TRANSPILE%3D1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant