Skip to content

Commit

Permalink
Merge pull request #2463 from 9rnsr/fix4481
Browse files Browse the repository at this point in the history
Issue 4481 - ICE(glue.c,!vthis->csym) or compiles, depending on the import statements order
  • Loading branch information
andralex committed Aug 12, 2013
2 parents b55f805 + 165f15b commit 2389c35
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/glue.c
Expand Up @@ -792,7 +792,6 @@ void FuncDeclaration::toObjFile(int multiobj)

if (vthis)
{
assert(!vthis->csym);
sthis = vthis->toSymbol();
irs.sthis = sthis;
if (!(f->Fflags3 & Fnested))
Expand Down
5 changes: 5 additions & 0 deletions test/compilable/ice4481.d
@@ -0,0 +1,5 @@
// EXTRA_SOURCES: imports/b4481.d
import imports.a4481;
import imports.b4481;

void main() {}
9 changes: 9 additions & 0 deletions test/compilable/imports/a4481.d
@@ -0,0 +1,9 @@
module imports.a4481;

template reduce(alias pred)
{
auto reduce(R)(R range)
{
return pred(range[0]);
}
}
14 changes: 14 additions & 0 deletions test/compilable/imports/b4481.d
@@ -0,0 +1,14 @@
module imports.b4481;

import imports.a4481;

class Font
{
public:
int charHeight(dchar c) { return 0; }
int textHeight(in string text)
{
auto maxHeight = (dchar ch) { return charHeight(ch); };
return reduce!(maxHeight)(text);
}
}

0 comments on commit 2389c35

Please sign in to comment.