Skip to content

Unsound use of {this} in constant initialization #2923

Open
@MikaelMayer

Description

@MikaelMayer

The following crashes:

class Dummy {
  const i: int
  constructor(i: int) {
    this.i := i;
  }
}
class ThisError {
  const d: Dummy
  const t: set<ThisError> := {this}

  constructor() {
    var x := set n: ThisError | n in t :: n.d.i;
    d := new Dummy(1);
    new;
  }
}

method Main() {
  var x := new ThisError();
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions