Semantic Diff

#8987 List float and bigint in the error for an invalid @as payload

1 commit

9e2f371482f529406d70df0565784aa8df3554e9..pr-8987

2f2d098ad · Christoph Knittel with Claude Opus 5.5 · Oct 23, 2026

List float and bigint in the error for an invalid @as payload

Why

@as accepts float and bigint literals, but the error for any other payload listed only strings, integers, booleans, null and undefined. The untagged variants spec, which quotes the message, now matches it, and its rule 6 table gives the wording printed for arrays and tuples.

modifiedDiagnostic invalid @as payload

type t = | @as(foo) A | B
diagnostic
Before
After
A variant case annotation @as(...) must be a string, integer, boolean, null, or undefined.A variant case annotation @as(...) must be a string, integer, float, bigint, boolean, null, or undefined.