[Issue 10465] New: ReturnType does not store the storage class
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Jun 24 13:55:35 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10465
Summary: ReturnType does not store the storage class
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: nobody at puremagic.com
ReportedBy: andrej.mitrovich at gmail.com
--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-06-24 13:55:34 PDT ---
-----
import std.traits;
ref int foo(ref int);
void main()
{
alias ReturnType!foo function(ParameterTypeTuple!foo) Bar;
int x;
Bar bar;
static assert(!__traits(compiles, bar(5) )); // ok, can't take r-value
static assert(__traits(compiles, bar(x) )); // ok, takes l-value
pragma(msg, Bar); // 'int function(ref int)' -- missing ref return
bar(x) = 5; // Error: (*bar)(x) is not an lvalue
}
-----
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list