Thread overview | |||||
---|---|---|---|---|---|
|
May 11, 2006 [Bug 135] New: typeof(x)() doesn't compile | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/bugzilla/show_bug.cgi?id=135 Summary: typeof(x)() doesn't compile Product: D Version: 0.156 Platform: PC OS/Version: Linux Status: NEW Keywords: rejects-valid Severity: minor Priority: P3 Component: DMD AssignedTo: bugzilla@digitalmars.com ReportedBy: oskar.linde@gmail.com struct X { void opCall() {} } X x; typeof(x)(); // Error: found '(' when expecting '.' following 'typeof(x)' Workarounds: 1. typeof(x).opCall(); 2. template T(_T) { alias _T T; } T!(typeof(x))(); 3. template mytypeof(alias x) { alias typeof(x) mytypeof; } mytypeof!(x)(); // For globally/statically declared X. -- |
May 11, 2006 [Bug 135] typeof(x)() doesn't compile | ||||
---|---|---|---|---|
| ||||
Posted in reply to d-bugmail | http://d.puremagic.com/bugzilla/show_bug.cgi?id=135 ------- Comment #1 from oskar.linde@gmail.com 2006-05-11 05:38 ------- Oops, I meant to type: struct X { static void opCall() {} } -- |
Copyright © 1999-2021 by the D Language Foundation