[Issue 1142] New: .stringof performs semantic analysis
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Apr 13 18:39:20 PDT 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1142
Summary: .stringof performs semantic analysis
Product: D
Version: 1.012
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: bugzilla at digitalmars.com
ReportedBy: clugdbug at yahoo.com.au
According to the spec, "If applied to an expression, it is the source
representation of that expression. Semantic analysis is not done for that
expression."
But it seems that semantic analysis always occurs. This does not compile:
---
const char [] q = (1.2143*nonexistent).stringof;
---
By contrast, is() expressions also don't do semantic analysis, and they work
correctly:
static assert(!is(typeof(1.2143*nonexistent)));
--
More information about the Digitalmars-d-bugs
mailing list