Skip to content

Throwing initializers don't support throw code inline #26438

Open
@bradcray

Description

In working on #26430 I found that initializers that throw can do so by calling a procedure that throws, but not by using throw statements themselves directly (or at least, the ones I tried). Support for throwing initializers is a WIP and it may be that this is a known limitation of the current implementation, but I couldn't find a mention of it in the technote about throwing initializers, so wanted to capture the issue here.

It seems as though the implementation of this could be fairly straightforward:

  • check whether the initializer throws
  • if it does, outline all code following the init this; into a nested procedure that throws, replacing it with a call to that procedure

test/classes/initializers/errors/errHandling/throwWithoutHelper.chpl #26430

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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