Skip to content

Classes: handle typestate correctly in ctors #2293

Closed
@catamorphism

Description

@catamorphism

Enforce these invariants in typestate:

"The constructor must initialize all fields of the object and cannot call any methods on self until it has done so." (currently there's no check that the ctor initializes fields, even)

"After calling a method on self, the constructor is not allowed to mutate any of its immutable fields."

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions