Bug 9693 – unclear scoping behaviour of declarations made in static if conditions

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-11T17:14:31Z
Last change time
2024-12-13T18:04:42Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
timon.gehr
Moved to GitHub: dmd#18533 →

Comments

Comment #0 by timon.gehr — 2013-03-11T17:14:31Z
With DMD 2.062, the following code compiles and runs: void main() { int[string] x; static if (is(typeof(x) S : T[U], T, U)) { } pragma(msg, S, " ", T, " ", U); } This is not evident from the spec. The spec should clarify whether this is supposed to compile or not. If it is not, the compiler implementation should be fixed.
Comment #1 by k.hara.pg — 2013-03-11T22:40:19Z
I think this is definitely a bug. There is no usefulness. Long time ago I found the bug, but I couldn't fix the bug. As far as I know, std.typecons.Rebindable implementation is relied on this buggy/bad feature.
Comment #2 by robert.schadek — 2024-12-13T18:04:42Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18533 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB