codemix / babel-plugin-typecheck

Static and runtime type checking for JavaScript in the form of a Babel plugin.
MIT License
886 stars 44 forks source link

Iterator support? #69

Closed mathieumg closed 8 years ago

mathieumg commented 8 years ago

I'm converting my codebase from Babel 5 to 6 and was wondering whether the Map, Set, Iterator and other such types were supported? I get the following Iterable is not defined error with the following annotation:

methodName(patterns: Iterable<string | Array<string>>) {
 // content.
}

Thank you!

phpnode commented 8 years ago

We support Map<keyType, valueType>, Set<valueType>, Array<valueType> and Generator<yieldType, returnType> but not a generic Iterable, partly because flow doesn't have a way of sensibly annotating symbols at the moment. I'll have a think about how we could implement it.