Skip to content

Commit 4d44187

Browse files
authored
Fix Issue 22769: ICE on IFTI call inside interpolated string (dlang#22784)
1 parent f18ac3e commit 4d44187

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

compiler/src/dmd/expressionsem.d

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5852,8 +5852,10 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
58525852
{
58535853
arguments.push(makeTemplateItem(Id.InterpolatedExpression, str));
58545854
Expressions* mix = new Expressions(new StringExp(e.loc, str));
5855-
// FIXME: i'd rather not use MixinExp but idk how to do it lol
5856-
arguments.push(new MixinExp(e.loc, mix));
5855+
auto mixinExp = new MixinExp(e.loc, mix);
5856+
auto res = mixinExp.expressionSemantic(sc);
5857+
res = resolveProperties(sc, res);
5858+
arguments.push(res);
58575859
}
58585860
}
58595861

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// https://github.com/dlang/dmd/issues/22769
2+
3+
int foo()() => 0;
4+
5+
void bar()
6+
{
7+
cast(void) i"$(foo)";
8+
}
9+
10+
struct OutBuffer
11+
{
12+
void opOpAssign(string op, T...)(T args) {}
13+
}
14+
15+
void qux()
16+
{
17+
OutBuffer buf;
18+
buf ~= i"$(foo)";
19+
}

0 commit comments

Comments
 (0)