Bug 764 – (typeof(o)).classinfo causes parser error

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2006-12-28T17:56:00Z
Last change time
2015-06-09T05:15:14Z
Assigned to
bugzilla
Creator
ddaglas

Comments

Comment #0 by ddaglas — 2006-12-28T17:56:41Z
For the following source code: void main() { Object o = new Object(); printf("%*s\n", typeof(o).classinfo.name); // compiles ok printf("%*s\n", (typeof(o)).classinfo.name); // error } compilation fails (on win32) with the following message: main.d(4): found '.' when expecting ',' --- errorlevel 1
Comment #1 by ddaglas — 2006-12-28T19:35:19Z
== Quote from d-bugmail ([email protected])'s article > http://d.puremagic.com/issues/show_bug.cgi?id=764 > Summary: (typeof(o)).classinfo causes parser error > Product: D > Version: unspecified > Platform: PC > OS/Version: Windows > Status: NEW > Severity: normal > Priority: P2 > Component: DMD > AssignedTo: [email protected] > ReportedBy: [email protected] > For the following source code: > void main() { > Object o = new Object(); > printf("%*s\n", typeof(o).classinfo.name); // compiles ok > printf("%*s\n", (typeof(o)).classinfo.name); // error > } > compilation fails (on win32) with the following message: > main.d(4): found '.' when expecting ',' > --- errorlevel 1 On a related note, compiling with -H added the ()'s around the typeof(...) in the resulting .di file, which subsequently triggered the bug. Is it a bug that DMD adds the ()'s around the typeof(...)? --Dan
Comment #2 by bugzilla — 2007-01-03T22:16:01Z
Fixed DMD 1.00
Comment #3 by thomas-dloop — 2007-02-27T10:48:01Z