BVB Source Codes

prettier Show forof.js Source code

Return Download prettier: download forof.js Source code - Download prettier Source code - Type:.js
  1. /**
  2.  * @flow
  3.  */
  4.  
  5. function testArray(arr: Array<number>): void {
  6.   for (var x of arr) {
  7.     (x: string); // Error - number ~> string
  8.   }
  9. }
  10.  
  11. function testIterable1(iterable: Iterable<number>): void {
  12.   for (var x of iterable) {
  13.     (x: string); // Error - number ~> string
  14.   }
  15. }
  16.  
  17. function testIterable2(iterable: Iterable<*>): void {
  18.   for (var x of iterable) {
  19.     (x: string);
  20.   }
  21. }
  22.  
  23. function testString(str: string): void {
  24.   for (var x of str) {
  25.     (x: number); // Error - string ~> number
  26.   }
  27. }
  28.  
  29. function testMap1(map: Map<string, number>): void {
  30.   for (var elem of map) {
  31.     (elem: [string, number]);
  32.     (elem: number); // Error - tuple ~> number
  33.   }
  34. }
  35.  
  36. function testMap2(map: Map<*, *>): void {
  37.   for (var elem of map) {
  38.     (elem: [number, string]); // Any tuple is fine
  39.     (elem: number); // Error - tuple ~> number
  40.   }
  41. }
  42.  
  43. function testSet1(set: Set<string>): void {
  44.   for (var x of set) {
  45.     (x: number); // Error - string ~> number
  46.   }
  47. }
  48.  
  49. function testSet2(set: Set<*>): void {
  50.   for (var x of set) {
  51.     (x: number); // Anything goes
  52.   }
  53. }
  54.  
downloadforof.js Source code - Download prettier Source code
Related Source Codes/Software:
storybook - 2017-06-07
ionicons - The premium icon font for Ionic ... 2017-06-07
AsyncDisplayKit - Smooth asynchronous user interfaces for iOS apps. ... 2017-06-07
lottie-android - Render After Effects animations natively on Androi... 2017-06-07
parse-server - Parse-compatible API server module for Node/Expres... 2017-06-07
inferno - An extremely fast, React-like JavaScript library f... 2017-06-08
guetzli - Perceptual JPEG encoder 2017-06-08
cs-video-courses - List of Computer Science courses with video lectur... 2017-06-08
interviews - Everything you need to know to get the job. 2017-06-08
prepack - Prepack is a partial evaluator for JavaScript. Pre... 2017-06-08
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
postal - 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top