Skip to content

Commit

Permalink
Fix #1059: String "interpolation", invalid cast when emitting "IL wit…
Browse files Browse the repository at this point in the history
…h C#"
  • Loading branch information
siegfriedpammer committed Feb 24, 2018
1 parent 3892762 commit 0ffc747
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Expand Up @@ -985,11 +985,11 @@ public virtual void VisitInterpolatedStringExpression(InterpolatedStringExpressi
{
StartNode(interpolatedStringExpression);

writer.WriteToken(Roles.Error, "$\"");
writer.WriteToken(InterpolatedStringExpression.OpenQuote, "$\"");
foreach (var element in interpolatedStringExpression.Content) {
element.AcceptVisitor(this);
}
writer.WriteToken(Roles.Error, "\"");
writer.WriteToken(InterpolatedStringExpression.CloseQuote, "\"");
isAfterSpace = false;

EndNode(interpolatedStringExpression);
Expand Down
Expand Up @@ -7,6 +7,9 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
{
public class InterpolatedStringExpression : Expression
{
public static readonly TokenRole OpenQuote = new TokenRole("$\"");
public static readonly TokenRole CloseQuote = new TokenRole("\"");

public AstNodeCollection<InterpolatedStringContent> Content {
get { return GetChildrenByRole(InterpolatedStringContent.Role); }
}
Expand Down

0 comments on commit 0ffc747

Please sign in to comment.