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
Description
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