-
-
Notifications
You must be signed in to change notification settings - Fork 606
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2585 from rainers/issue10993
fix Issue 10993: mangling of voldemort types with lambdas changes during return type inference
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
module test10993; | ||
|
||
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; | ||
} | ||
|
||
void main() | ||
{ | ||
const x = fun(); | ||
enum mangle_x = typeof(x).mangleof; | ||
// pragma(msg, "x : " ~ mangle_x); | ||
auto y = cast()x; | ||
enum mangle_y = typeof(y).mangleof; | ||
// pragma(msg, "y : " ~ mangle_y); | ||
static assert (mangle_y == mangle_x[1..$]); | ||
} |