Skip to content

toString does not work in u64 array #680

Closed
@bowenwang1996

Description

@bowenwang1996

Consider the following two functions

export function test(): string {
  let a: u64 = 1;
  return a.toString();
}

export function test1(): string {
  let arr: u64[] = Array.create<u64>(1);
  arr[0] = 1;
  return arr[0].toString();
}

The first one compiles but the second one doesn't and the error is

ERROR TS2339: Property 'toString' does not exist on type 'u64'.

   return arr[0].toString();
                 ~~~~~~~~

Fiddle example here

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