Skip to content

Slightly confusing language in variable-bindings.md #20840

Closed
@trevorloflin

Description

@trevorloflin

On line 91, the book states: "bindings are required to be initialized with a value". However, the example error that it gives, "error: cannot determine a type for this local variable", is not about initialization but rather about declaration. This is immediately confirmed when "let x: i32;" is shown to compile. Only several lines later, on lines 133 and following, does the book show an actual uninitialized variable error. For people new to complex type systems, it is important to explain the distinction between an uninitialized value and an undeclared (and non-inferable) type.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions