Skip to content

Error encountered while using the toInt function #131

@lanbairua

Description

@lanbairua

Hello,

I encountered a problem while using the bigints library. When I tried to use the toInt function to convert a value of type BigInt to type int, the following error message appeared:

template/generic instantiation of `toInt` from here
Error: cannot instantiate: 'T'

Here is my code snippet:

# 示例
var charset = "abc"
let length = 2
let startFrom = "ab"
let endAt = "bc"
let startNumber: BigInt = getStartNumber(startFrom, charset, length)
let endNumber: BigInt = getEndNumber(endAt, charset, length)

for i in startNumber..endNumber:
  echo fromDecimal(charset, i.toInt, length)

My Nim version is nim-1.6.4 and the bigints library version is bigints-1.1.0.

How can this problem be solved? Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions