Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

static/top-level const can hit use before define error #144

Closed
@jmesserly

Description

@jmesserly

Const can result in use-before-define errors as the code isn't sorted properly. library cycles make this worse, but the bug exists even with a single library, as the initializer expression isn't taken into account at all for class ordering. non-const final fields can hit this too, since we try to pretend they are const if possible.

Fortunately we already have means to codegen lazy fields, as that's how most statics work. So shouldn't be too bad, just need to track it.

Related issue on const canonicalization: #29

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions