const MEMORY_ADDRESS: u64 = 100;
let memory_address = BFieldElement::new(MEMORY_ADDRESS);
instead of that:
let memory_address = BFieldElement::new(100);
We can probably use a similar technique to what we did with the struct definitions: Add a literal variant "Unresolved" which must then be matched with the content of the associated constant declarations an appropriate place in the compiler pipeline, probably in types.rs where we are doing this match for structs.
Just like DataType has a method for resolve_type that takes the declared structs and maps any unresolved type to one of those, so too could resolve_literal map unresolved literals to those from a constant list stored in the type checkers CheckState struct.
Goal: To be allowed to write this
instead of that:
We can probably use a similar technique to what we did with the struct definitions: Add a literal variant "Unresolved" which must then be matched with the content of the associated constant declarations an appropriate place in the compiler pipeline, probably in
types.rs
where we are doing this match for structs.Just like
DataType
has a method forresolve_type
that takes the declared structs and maps any unresolved type to one of those, so too couldresolve_literal
map unresolved literals to those from a constant list stored in the type checkersCheckState
struct.