google / google/closure-compiler

spurious type errors involving maps

Open
#1,932 1 comment 0 reactions 0 assignees View on GitHub
OTI
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

When compiling this code (with --language_in=ES6_STRICT)...

``` js
/**
* @param {Map} map
* @template KEY, VALUE
*/
const foo = function(map) {
};

/**
* @param {Map} map
*/
const bar = function(map) {
foo(map);
};
```

...I get this warning:

```
test.js:12: WARNING - actual parameter 1 of foo does not match formal parameter
found : (Map|null)
required: (Map<(number|string),(number|string)>|null)
foo(map);
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.