Bug 13218 – [ICE] s2ir.c 142: Must fully qualify call to ParameterTypeTuple
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-07-27T19:57:00Z
Last change time
2014-08-22T08:05:05Z
Keywords
ice, pull
Assigned to
nobody
Creator
zshazz
Comments
Comment #0 by zshazz — 2014-07-27T19:57:40Z
The following code compiles on 2.065, but fails with "__error__\n\nInternal error: s2ir.c 142" on 2.066 b4 and b6
````
void main()
{
Reduced r;
}
struct Reduced
{
private static string mangleFuncPtr(ArgTypes...)()
{
string result = "fnp_";
foreach(T; ArgTypes) result ~= T.mangleof;
return result;
}
void function(int) fnp_i;
double delegate(double) fnp_d;
void opAssign(FnT)(FnT func)
{
import std.traits: ParameterTypeTuple;
// Here's the problem line:
mixin(mangleFuncPtr!(ParameterTypeTuple!FnT) ~ " = func;");
// Works:
//mixin(mangleFuncPtr!(std.traits.ParameterTypeTuple!FnT) ~ " = func;");
}
}
````
Note, as the comments say if you fully qualify std.traits.ParameterTypeTuple, it compiles and works just fine. (This is probably not reduced as much as possible, but it's a pretty small subset of the code in question. My apologies.)
Interestingly, I have code elsewhere that does essentially the same call, but it doesn't need to be fully qualified to not crash the compiler.