google / google/closure-compiler

Subtype property declaration not being picked up in supertype (even with strictMissingProperties off)

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

Description

Running with --jscomp_error=missingProperties --jscomp_off=strictMissingProperties

```
/** @typedef {{name: string}} */
let Action;

/**
* @param {!Array} ids
* @return {!Action}
*/
function setSearchResults(ids) {
return {
name: 'finish-search',
results: ids,
};
}

/**
* @param {Action} action
* @return {Array}
*/
function startSearch(action) {
return action.results;
};

```

In version Version: 1.0-SNAPSHOT Built on: 2018-04-09 12:37, this fails with

```
ERROR - Property results never defined on action
return action.results;
^^^^^^^

1 error(s), 0 warning(s), 87.5% typed
```

Whereas running with Version: 1.0-SNAPSHOT Built on: 2017-07-28 18:20 passes cleanly.

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.