BVB Source Codes

prettier Show generics.js Source code

Return Download prettier: download generics.js Source code - Download prettier Source code - Type:.js
  1. class C<X> {
  2.   x:X;
  3.   constructor(x:X) { this.x = x; }
  4.   get():X { return this.x; }
  5. }
  6.  
  7. class D<T> {
  8.   x:T;
  9.   m<S>(z:S,u:T,v):S {
  10.     this.x = u;
  11.     v.u = u;
  12.     return z;
  13.   }
  14. }
  15.  
  16. var d = new D();
  17. var o = {};
  18. var b = d.m(true,0,o);
  19. var s:string = d.x;
  20. var n:number = o.u;
  21.  
  22. class E<X> extends C<X> {
  23.     //x:X;
  24.     set(x:X):X { /*return x;*/ this.x = x; return /*this.x; */this.get(); }
  25. }
  26.  
  27. var e = new E(); // error: too few arguments to inherited constructor
  28. var x:string = e.set(0);
  29.  
  30. class F<X> { }
  31. class G<Y> extends F<Array<Y>> {}
  32. class H<Z> extends G<Array<Z>> {
  33.     x:Z;
  34.     foo(x:Z) { this.x = x; }
  35. }
  36.  
  37. var h1 = new H();
  38. h1.foo(["..."]);
  39. var h2:F<Array<Array<Array<number>>>> = h1;
  40.  
  41. var obj : Object<string, string> = {} // error, arity 0
  42. var fn : Function<string> = function() { return 'foo'; } // error, arity 0
  43. var fn : function<string> = function() { return 'foo'; } // error, arity 0
  44.  
downloadgenerics.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