Skip to content
  • Pinto Pasquale's avatar
    [#135] add custom Indigo fromInteger · 2afa4bb2
    Pinto Pasquale authored
    Problem: type signatures or annotations always need to be specified for
    numeric values in Indigo code, because they are otherwise ambiguous.
    However, Indigo uses `RebindableSyntax` that allows to define a
    `fromInteger` function used to resolve numeric literals, and this can
    be used to implement (some) custom resolution logic.
    
    Solution: implement a `fromInteger` that takes an additional value
    (beside the Integer) that provides disambiguation for the resulting
    value type, with function constructors for this type that match the
    target Michelson type.
    Additionally, because of this, the 'int' expression has been renamed
    'toInt'.
    2afa4bb2