Revised implicit type conversions; Initial function expression compilation

This commit is contained in:
dcodeIO
2018-02-28 01:48:01 +01:00
parent bda6cb9792
commit d4c00eaba3
36 changed files with 940 additions and 1754 deletions

View File

@ -13,7 +13,7 @@ export class Set<T> {
}
get size(): i32 {
return this.__size;
return <i32>this.__size;
}
// FIXME: not a proper set implementation, just a filler
@ -52,11 +52,11 @@ export class Set<T> {
for (var index: usize = 0, limit: usize = this.__size; index < limit; ++index) {
if (load<T>(this.__memory + index * sizeof<T>()) == value) {
if (index + 1 < this.__size) {
if (index + 1 < limit) {
move_memory(
this.__memory + index * sizeof<T>(),
this.__memory + (index + 1) * sizeof<T>(),
this.__size - index - 1
limit - index - 1
);
}
--this.__size;