navid/haze / 48ef02229ff0b40a4849e26fc1a9f371991f791d48bb426ffeb35dad068eb87d / samples/baseline_2.7/const_field_assign_error.hz

const_field_assign_error.hz

← samples/baseline_2.7 · 178 bytes · raw · download

// Fields cannot be assigned through a const value.

type Point {
    x i32
    y i32
}

fn main() {
    const point = Point{ x = 1, y = 2 }
    point.x = 5
    print(point.x)
}