[Issue 10993] New: mangling of voldemort types with lambdas changes during return type inference
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Sep 8 01:55:54 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10993
Summary: mangling of voldemort types with lambdas changes
during return type inference
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: r.sagitario at gmx.de
--- Comment #0 from Rainer Schuetze <r.sagitario at gmx.de> 2013-09-08 01:55:52 PDT ---
Reduced from the cartesianProduct unittests:
module test3;
//import std.traits;
auto foo(T)(T a)
{
static immutable typeof(a) q;
pragma(msg, "foo: " ~ typeof(q).mangleof);
return q;
}
struct test(alias fn)
{
bool ini = true;
void* p;
}
auto fun()
{
auto x = foo!()(test!(a=>a)());
pragma(msg, "fun: " ~ typeof(x).mangleof);
return x; //typeid(x);
}
void main()
{
const x = fun();
pragma(msg, "x : " ~ typeof(x).mangleof);
auto y = cast()x;
pragma(msg, "y : " ~ typeof(y).mangleof);
}
compile with "dmd test3.d" yields:
foo: yS5test33fun32__T4testS205test33fun9__lambda2Z4test
fun: yS5test33fun32__T4testS205test33fun9__lambda2Z4test
x : yS5test33fun32__T4testS205test33fun9__lambda2Z4test
y :
S5test33funFZyS5test33fun32__T4testS205test33fun9__lambda2Z4test32__T4testS
205test33fun9__lambda2Z4test
i.e. casting away immutable leads to a completely new mangling while it should
have removed the 'y' at the start only. This causes link errors when trying to
produce complete TypeInfo data.
--
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