Skip to content

Latest commit

 

History

History
46 lines (35 loc) · 1.16 KB

File metadata and controls

46 lines (35 loc) · 1.16 KB

12 Constants

12.1 Description

Inference supports the following types of constants:

Constants can be defined in the following structures:

Note

() unit type is a constant by definition because it does not have any other values except (). That is why we omit it in the list of constant types.

12.2 Examples

spec Constants {
    const a: i32 = 10;
    const b: bool = true;
    const c: u32 = 0;

    fn define_local_constants() {
        const d: i32 = 10;
        const e: bool = true;
        const f: u32 = 0;
    }
}


⏮️ Functions


⏭️ Directives