Skip to content

Initialization at declaration #626

Open
@certik

Description

@certik

Currently often code like x: i32 = 5 and x: i32[3] = empty(3) and such fails.

These are taken care of using expr? symbolic_value, expr? value members of Variable_t. We should rename these, perhaps to initial_value or something like that to make it clear, and document what the difference is between the two (I forgot).

We should go over all combinations of such initializations and make sure they all work, I think there are quite a few cases that don't work yet.

There is one more complication. In Fortran, the above is used for code like:

integer :: x = 5

Which in Fortran implies integer, save :: x = 5, the save attributed is represented by the storage_type = Save member of Variable_t. For Python, code like x: i32 = 5 should still store the initial value in Variable_t, but use storage_type = Default. Then in the LLVM backend we need to support both storage_types.

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