Skip to content

SyntaxFactory NumericForStatement constructor is missing a semicolon token #154

@toxamin

Description

@toxamin

What is the issue you are experiencing?

When a NumericForStatement is constructed using the following constructor NumericForStatementSyntax NumericForStatement(TypedIdentifierNameSyntax identifier, ExpressionSyntax initialValue, ExpressionSyntax finalValue, ExpressionSyntax? stepValue, StatementListSyntax body), the output expression does not have a semicolon token

What was the expected result?

The output expression has a semicolon token

What was the actual result?

The output expression does not have a semicolon token

What are the steps to reproduce this issue?

Run this code:

using Loretta.CodeAnalysis.Lua;
using Loretta.CodeAnalysis.Lua.Syntax;
using static Loretta.CodeAnalysis.Lua.SyntaxFactory;

LiteralExpressionSyntax Num(double d) => LiteralExpression(SyntaxKind.NumericalLiteralExpression, Literal(d));
var numFor = NumericForStatement(IdentifierName("i"), Num(1d), Num(10d), Num(2d), StatementList());
if (numFor.StepValueCommaToken.Kind() is SyntaxKind.None)
{
    throw new Exception("wtf");
}

What version of Loretta are you experiencing this issue in?

v0.2.14-nightly.5

What Lua versions are affected by this issue?

No response

Is there any additional information you wish to add?

No response

Please ensure you have done the following actions:

  • I have checked that there are no similar issues already open.
  • I confirm this is not an usage question but an actual bug within Loretta.
  • I have confirmed that this issue still happens on the latest nightly version.
  • I have confirmed that this issue is because of Loretta and not because of my own code.
  • I acknowledge my issue will be closed if any step has been skipped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions