Skip to content

Compiler crash for instance properties without this #1990

Closed
@MaxGraey

Description

@MaxGraey

This code just crash whole compiler:

class ArrayIterator {
  constructor(public start: i32, public end: i32) {}

  next(): i32 {
    let start = this.start + 1;
    if (start <= end) { // This line caused crash (just missing this.end)
      this.start = start;
      return start;
    }
    return -1;
  }
}

export function iter1(n: i32): i32 {
  let iter = new ArrayIterator(0, n);
  let acc = 0, val = 0;
  while ((val = iter.next()) != -1) {
    acc++;
  }
  return acc;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions