Skip to content

Ternary expression when condition True has a Bug  #53

Closed
@buweixiaomi

Description

@buweixiaomi

Expression: 1==1?true:false run will show exception.
Code in function "EvaluateTernaryConditionalOperator" under s2.Equals(":"):
stack.Push(condition ? Evaluate(restOfExpression.Substring(1, j-1)) : Evaluate(restOfExpression.Substring(j + 1)));
replace with
stack.Push(condition ? Evaluate(restOfExpression.Substring(0, j)) : Evaluate(restOfExpression.Substring(j + 1)));
It will be work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions