ziglang / zig

General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software.
https://ziglang.org
MIT License
32.4k stars 2.36k forks source link

Attempting to define a variable of anyopaque type shows no meaningful error #20534

Closed nothke closed 1 week ago

nothke commented 1 week ago

Zig Version

0.14.0-dev.144+a31fe8aa3

Steps to Reproduce and Observed Output

Defining an anyopaque like

const a: anyopaque = undefined;

..clearly makes no sense, but the compiler doesn't show any error message for it except just failing.

https://godbolt.org/z/sx8c6zv4b

Expected Output

Something like "Defining a constant/variable of anyopaque type is illegal"

Rexicon226 commented 1 week ago

duplicate of #16617