setLengthVarIfKnown

It is possible for constant folding to change an array expression of unknown length, into one where the length is known. If the expression 'arr' is a literal, set lengthVar to be its length.

  1. void setLengthVarIfKnown(VarDeclaration lengthVar, Expression arr)
    package
    void
    setLengthVarIfKnown
  2. void setLengthVarIfKnown(VarDeclaration lengthVar, Type type)

Parameters

lengthVar VarDeclaration

variable declaration for the .length property

arr Expression

String, ArrayLiteral, or of TypeSArray

Meta