clutz
clutz copied to clipboard
support for computed properties, especially with symbol keys.
The following ES6 Closure code (from https://github.com/google/closure-compiler/blob/master/externs/browser/fetchapi.js#L87)
/**
* @see https://fetch.spec.whatwg.org/#headers
* @constructor
* @implements {Iterable<!string>}
*/
var A = function() {};
/** @return {!Iterator<!string>} */
A[Symbol.iterator] = function() {};
produces (note no symbol.Iterator property)
class A implements Iterable < string > {
private noStructuralTyping_: any;
}
Which errors with Property '[Symbol.iterator]' is missing in type 'Headers_Instance'.
If it has @constructor
, it's not an interface, right? I think the Closure code is not correct.
botched the example and the title orginally, should make more sense now.