diff --git a/contractabi/selector.nim b/contractabi/selector.nim index f015640..51f7b27 100644 --- a/contractabi/selector.nim +++ b/contractabi/selector.nim @@ -61,7 +61,7 @@ func solidityType*(Tuple: type tuple): string = names.add(solidityType(typeof parameter)) "(" & names.join(",") & ")" -func solidityType*(T: distinct type): string = +func solidityType*[T: distinct](_: type T): string = solidityType(distinctBase T) func signature*(function: string, Parameters: type tuple = ()): string = diff --git a/tests/contractabi/testDecoding.nim b/tests/contractabi/testDecoding.nim index 92d4e1b..139bd0f 100644 --- a/tests/contractabi/testDecoding.nim +++ b/tests/contractabi/testDecoding.nim @@ -4,7 +4,8 @@ import contractabi import ./examples type SomeDistinctType = distinct uint16 -func `==`*(a, b: SomeDistinctType): bool {.borrow.} +func `==`*(a, b: SomeDistinctType): bool = + uint16(a) == uint16(b) suite "ABI decoding":