The Haskell implementation will happily parse an arbitrarily large index on an identifier (although it looks like something's overflowing either in the representation or the encoding):
$ dhall encode --json <<< "x @ 9223372036854775808"
[
"x",
-9223372036854775808
]
We stop at Long.MaxValue:
scala> import org.dhallj.parser.DhallParser
import org.dhallj.parser.DhallParser
scala> DhallParser.parse("x @ 9223372036854775807")
res0: org.dhallj.core.Expr.Parsed = x@9223372036854775807
scala> DhallParser.parse("x @ 9223372036854775808")
java.lang.NumberFormatException: For input string: "9223372036854775808"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)
at java.base/java.lang.Long.parseLong(Long.java:703)
...
I think this is fine, since nobody's ever going to bind 9,223,372,036,854,775,808 xs, so this will never type-check, anyway, but we should document the difference and maybe wrap the NumberFormatException in an ParseException.
The Haskell implementation will happily parse an arbitrarily large index on an identifier (although it looks like something's overflowing either in the representation or the encoding):
We stop at
Long.MaxValue:I think this is fine, since nobody's ever going to bind 9,223,372,036,854,775,808
xs, so this will never type-check, anyway, but we should document the difference and maybe wrap theNumberFormatExceptionin anParseException.