Bug 6868 – IsExp + incorrect static array type = error

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-10-30T14:16:00Z
Last change time
2011-11-15T00:25:52Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2011-10-30T14:16:42Z
Code: ---- @property bool empty(T)(in T[] a) @safe pure nothrow { return !a.length; } void main() { alias int[] Range; static if (is(char[1 + Range.empty])) // Line 9 enum bool isInfinite = true; char[0] s; // need } Output: ---- test.d(9): Error: Integer constant expression expected instead of cast(uint)(1 + cast(int)empty((__error)))
Comment #1 by k.hara.pg — 2011-10-30T14:23:36Z
Original code: ---- import std.range; void main() { pragma(msg, isInfinite!(int[])); char[0] s; // need }
Comment #2 by k.hara.pg — 2011-10-30T15:04:37Z
https://github.com/D-Programming-Language/dmd/pull/482 And change importance: normal -> major In my opinion, this issue is important, because std.range.isInfinite is used frequently.
Comment #3 by bugzilla — 2011-11-15T00:25:52Z