blickly / closure-compiler-issues

0 stars 0 forks source link

Inappropriate warning about the type of the arguments object #107

Closed blickly closed 9 years ago

blickly commented 9 years ago
What steps will reproduce the problem?

Try to compile the following snippet:

/** @param {!Arguments} x */
function f(x) {
  alert(x.length);
}

/** @param {...*} x */
function g(x) {
  f(arguments);
}

g(1, 2);

What is the expected output? What do you see instead?

I get an unexpected warning:

JSC_TYPE_MISMATCH: actual parameter 1 of f does not match formal parameter
found   : (Arguments|null)
required: Arguments at line 8 character 4
  f(arguments);

What version of the product are you using? On what operating system?
r99 at http://closure-compiler.appspot.com/

Original issue reported on code.google.com by pallosp on 2010-02-10 15:55:22

blickly commented 9 years ago
(No text was entered with this change)

Original issue reported on code.google.com by Nicholas.J.Santos on 2010-02-10 19:13:06

blickly commented 9 years ago
fixed by r100

Original issue reported on code.google.com by Nicholas.J.Santos on 2010-02-10 21:06:57