ripple / ripple-lib-extensions

[Deprecated] A collection of extensions to ripple-lib. Instead, see https://github.com/XRPLF/xrpl.js
https://github.com/XRPLF/xrpl.js
22 stars 31 forks source link

[ripple-lib-value] typecheck fails #46

Closed intelliot closed 4 years ago

intelliot commented 4 years ago
value master % npm run typecheck

> ripple-lib-value@0.2.1 typecheck /Users/elliotlee/ripple/ripple-lib-extensions/value
> babel --optional runtime --blacklist flow -d build/flow/ src/ && flow check

src/index.js -> build/flow/index.js
src/iouvalue.js -> build/flow/iouvalue.js
src/value.js -> build/flow/value.js
src/xrpvalue.js -> build/flow/xrpvalue.js
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ build/flow/iouvalue.js:36:44

Cannot use Value as a type. A name can be used as a type only if it refers to a type definition, an interface
definition, or a class definition. To get the type of a non-class value, use typeof.

     33│
     34│   _createClass(IOUValue, [{
     35│     key: 'multiply',
     36│     value: function multiply(multiplicand: Value) {
     37│       if (multiplicand instanceof XRPValue) {
     38│         return _get(Object.getPrototypeOf(IOUValue.prototype), 'multiply', this).call(this, new IOUValue(multiplicand._value.times(rippleUnits)));
     39│       }

Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ build/flow/iouvalue.js:44:37

Cannot use Value as a type. A name can be used as a type only if it refers to a type definition, an interface
definition, or a class definition. To get the type of a non-class value, use typeof.

     41│     }
     42│   }, {
     43│     key: 'divide',
     44│     value: function divide(divisor: Value) {
     45│       if (divisor instanceof XRPValue) {
     46│         return _get(Object.getPrototypeOf(IOUValue.prototype), 'divide', this).call(this, new IOUValue(divisor._value.times(rippleUnits)));
     47│       }
[...]
intelliot commented 4 years ago

Fixed by migrating to TypeScript