clutz icon indicating copy to clipboard operation
clutz copied to clipboard

support for computed properties, especially with symbol keys.

Open rkirov opened this issue 8 years ago • 2 comments

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'.

rkirov avatar Aug 12 '16 01:08 rkirov

If it has @constructor, it's not an interface, right? I think the Closure code is not correct.

mprobst avatar Aug 12 '16 16:08 mprobst

botched the example and the title orginally, should make more sense now.

rkirov avatar Aug 12 '16 17:08 rkirov