You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I guess this comes down to the Map iterator returning ([K, V], [K, V] ...) and JSCompiler does not know better than to treat these as Array<K|V>. Maybe there needs to be some special case for this since this pattern is super useful.
I'm seeing cases where the type of the key of a Map is flagged as the type of the key|value
For repro see.
https://closure-compiler.appspot.com/home#code%3D%252F%252F%2520%253D%253DClosureCompiler%253D%253D%250A%252F%252F%2520%2540compilation_level%2520ADVANCED_OPTIMIZATIONS%250A%252F%252F%2520%2540output_file_name%2520default.js%250A%252F%252F%2520%2540formatting%2520pretty_print%250A%252F%252F%2520%253D%253D%252FClosureCompiler%253D%253D%250A%250A%252F%252F%2520ADD%2520YOUR%2520CODE%2520HERE%250A%252F**%250A%2520*%2520%2540param%2520%257B!Map%253Cstring%252C%2520number%253E%257D%2520m%250A%2520*%252F%250Afunction%2520hello(m)%2520%257B%250A%2520%2520for%2520(const%2520%255Bk%252C%2520v%255D%2520of%2520m)%2520%257B%250A%2520%2520%2520%2520g(k)%250A%2520%2520%257D%250A%257D%250A%250A%252F**%250A%2520*%2520%2540param%2520%257Bstring%257D%2520s%250A%2520*%252F%250Afunction%2520g(s)%2520%257B%257D%250Ahello(new%2520Map())%253B%250A%250A
The text was updated successfully, but these errors were encountered: