Commit Graph
3 Commits
Author SHA1 Message Date
Chris Tate 437dc1163f Refuse recursive unions in comptime baking
The bakeability check tracks the unions it is inside as well as the
records, so a union reachable from itself through an array
(`type Tree = number | Tree[]`) reports SC1090 instead of recursing without
end. The message names both recursive records and recursive unions.
2026-10-20 11:39:23 -05:00
Chris Tate 45431aec32 Choose comptime union arms by discriminant and refuse recursive records
A comptime record value whose union has a discriminant takes the arm its
discriminant field names, so a value that fits two arms with overlapping
shapes gets that arm's tag and layout instead of the first arm it fits.
comptimeBakeable reports a record type reachable from its own fields as
not bakeable instead of recursing without end, so such a comptime result
reports SC1090, and the message names unions and that limit.
2026-10-20 02:01:48 -05:00
Chris Tate 23d5918a53 init 2026-07-22 18:08:04 -05:00