1291 – .stringof for a class type returned from a template doesn't work

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1291 - .stringof for a class type returned from a template doesn't work
Summary: .stringof for a class type returned from a template doesn't work
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: Other Linux
: P2 normal
Assignee: Walter Bright
URL:
Keywords:
Depends on:
Blocks:
Reported: 2007年06月24日 14:55 UTC by Jari-Matti Mäkelä
Modified: 2014年02月16日 15:21 UTC (History)
0 users

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Jari-Matti Mäkelä 2007年06月24日 14:55:15 UTC
Code:
 template t() { alias Object t; }
 pragma(msg, t!().stringof);
Compiler output:
bug.d(2): Error: undefined identifier class Object.stringof
bug.d(2): pragma msg string expected for message, not 'class Object.stringof'
----
t!() should return type 'Object' which is a valid type and for which .stringof exists. For example this works:
 alias Object t;
 pragma(msg, t.stringof);
Comment 1 Walter Bright 2007年07月01日 14:09:32 UTC
Fixed DMD 1.018 and DMD 2.002


AltStyle によって変換されたページ (->オリジナル) /