Skip to content

Allow WithStmts in static initialisers to contain statements #1610

@Rua

Description

@Rua

Currently, returning a WithStmts that contains statements, inside a static initialiser, triggers a panic: "Expected no side-effects in static initializer". But that requirement is too tight: it's perfectly valid for static initialisers to contain statements, at least if they are declaration statements.

This issue currently blocks #1582. The solution used in #1407 works for local variables, but can't be extended to statics because of the panic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions