google / google/closure-compiler
The current type checker fails to detect a type mismatch involving type interface
Open
OTI
Types
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
The last two assignments in function `f` should trigger warnings in the current type system.
``` javascript
/**
* @interface
* @template KEY1, VALUE1
*/
var IObject = function() {};
/**
* @interface
* @extends {IObject}
* @template VALUE2
*/
var IArrayLike = function() {};
/**
* @constructor
* @implements {IArrayLike}
*/
function Int8Array2() {}
function f() {
/** @type {Int8Array2} */
var x = new Int8Array2();
/** @type {IArrayLike} */
var y;
y = x; // should have a warning here
/** @type {IObject} */
var z;
z = x; // should have a warning here
}
```
Contributor guide
Assessment
This issue has not been assessed yet.