Odin icon indicating copy to clipboard operation
Odin copied to clipboard

Declaring constants in defer block results in "undeclared name"

Open FourteenBrush opened this issue 11 months ago • 1 comments

Context

Relevant code:

package bug

t :: proc() {
    defer {
        x :: 1
        y := x + 1
    }
}

Results in image

This happens with any type for x

  • Operating System & Odin Version: Odin: dev-2024-11:8f2766c4d OS: Fedora Linux 40 (KDE Plasma), Linux 6.11.4-201.fc40.x86_64 CPU: AMD Ryzen 7 5800H with Radeon Graphics
    RAM: 13817 MiB Backend: LLVM 18.1.8

Steps to Reproduce

Simple odin run -file bug.odin

FourteenBrush avatar Nov 17 '24 22:11 FourteenBrush