microsoft / Kusto-Query-Language

Kusto Query Language is a simple and productive language for querying Big Data.
Apache License 2.0
510 stars 97 forks source link

Regression: range type stops being correctly inferred between 11.5.2 and 11.5.3 #141

Closed NeilMacMullen closed 1 month ago

NeilMacMullen commented 1 month ago

Possibly related to https://github.com/microsoft/Kusto-Query-Language/issues/134

In 11.5.2 the query

  range x from 0 to 5 step 0.5

generates this tree

 List: range x from 0 to 5 step 0.5: 
  SeparatedElement: range x from 0 to 5 step 0.5: 
   ExpressionStatement: range x from 0 to 5 step 0.5: 
    RangeOperator: range x from 0 to 5 step 0.5: (x: real)
     NameDeclaration: x: 
      TokenName: x: 
     LongLiteralExpression: 0: long
     LongLiteralExpression: 5: long
     RealLiteralExpression: 0.5: real

In 11.5.3 the RangeOperator incorrectly infers that x is long...

 List: range x from 0 to 5 step 0.5: 
  SeparatedElement: range x from 0 to 5 step 0.5: 
   ExpressionStatement: range x from 0 to 5 step 0.5: 
    RangeOperator: range x from 0 to 5 step 0.5: (x: long)
     NameDeclaration: x: 
      TokenName: x: 
     LongLiteralExpression: 0: long
     LongLiteralExpression: 5: long
     RealLiteralExpression: 0.5: real
mattwar commented 1 month ago

This is fixed in 11.5.4