Bug 1366 – Inconsistent __traits usage

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2007-07-23T05:40:00Z
Last change time
2014-02-14T20:35:15Z
Keywords
rejects-valid
Assigned to
nobody
Creator
ddparnell

Comments

Comment #0 by ddparnell — 2007-07-23T05:40:15Z
This works ... import std.stdio; void main(string[] pArgs) { auto x = pArgs.idup; writefln(__traits(isStaticArray,x)); } This fails ... import std.stdio; void main(string[] pArgs) { writefln(__traits(isStaticArray, pArgs.idup)); } The message I get is ... test.d(4): Error: cannot evaluate _adDupT(&D13TypeInfo_AAxa6__initZ,(const(char) [][])) at compile time
Comment #1 by hoganmeier — 2010-02-04T19:39:44Z
Error message has changed. import std.stdio; void main(string[] pArgs) { auto x = pArgs.idup; writeln(__traits(isStaticArray,x)); } works, but void main(string[] pArgs) { writeln(__traits(isStaticArray, pArgs.idup)); } yields Error: Cannot interpret string[] at compile time now
Comment #2 by clugdbug — 2011-04-15T21:19:08Z
This is one of at least 8 bugs fixed by this commit: https://github.com/donc/dmd/commit/fc67046cf1e66182d959309fb15ef9e2d4c266b9