Skip to content

Commit bee3b73

Browse files
authored
fix: Use explicit cast in Usize/Isize#toString (#1517)
1 parent 32d10b4 commit bee3b73

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

std/assembly/number.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ export abstract class Isize {
114114

115115
toString(this: isize, radix: i32 = 10): String {
116116
if (sizeof<isize>() == 4) {
117-
return itoa32(this, radix);
117+
return itoa32(<i32>this, radix);
118118
} else {
119-
return itoa64(this, radix);
119+
return itoa64(<i64>this, radix);
120120
}
121121
}
122122
}
@@ -217,10 +217,10 @@ export abstract class Usize {
217217
}
218218

219219
toString(this: usize, radix: i32 = 10): String {
220-
if (sizeof<isize>() == 4) {
221-
return utoa32(this, radix);
220+
if (sizeof<usize>() == 4) {
221+
return utoa32(<u32>this, radix);
222222
} else {
223-
return utoa64(this, radix);
223+
return utoa64(<u64>this, radix);
224224
}
225225
}
226226
}

0 commit comments

Comments
 (0)