Joseph Ferano
879a439951
A written zero stands where a numeric type variable stands
...
pos? over every numeric type from one definition was the motivating
example for milestone 5 and was the one thing the landed generics could
not write: (> x 0) refused with "expected t, found the integer literal
0", because int_literal had no arm for a want that is a type variable.
It has one now, and the bound is what makes it sound rather than
optimistic. Every type numeric? admits is an integer or a float, and an
untyped integer constant is usable at all of them, so there is no
instantiation of a numeric? variable at which the literal has no
meaning. Under a weaker bound there is -- ordered? admits an enum -- so
numeric? is what is asked for and the refusal names it.
The float literal is refused at a type variable even under numeric?,
and that asymmetry is the concrete arms' own: an integer constant is
usable where a float is wanted and a float literal is never usable
where an integer is wanted, so a body written with 0.5 has no meaning
at the integer half of its own bound. Refusing at the definition is
what the abstract pass is for; the alternative is a surprise at
whichever call site first asks for i32.
The node the abstract pass builds is never emitted. Each copy
re-checks the same form with the variable substituted, and that is
where the literal is built at the concrete width and range-checked --
so (+ x 300) is fine at i32 and a refusal at u8, and u8 is where it is
refused.
2026-09-20 20:21:41 +07:00
..
2026-09-19 06:41:57 +07:00
2026-09-20 19:56:17 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 10:47:41 +07:00
2026-09-12 05:32:25 +07:00
2026-09-19 05:21:02 +07:00
2026-09-12 10:55:18 +07:00
2026-09-17 20:37:08 +07:00
2026-09-17 20:37:08 +07:00
2026-09-13 22:55:26 +07:00
2026-09-13 23:09:08 +07:00
2026-09-12 21:48:08 +07:00
2026-09-14 07:12:27 +07:00
2026-09-18 07:36:21 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 23:06:40 +07:00
2026-09-12 23:06:40 +07:00
2026-09-12 23:18:28 +07:00
2026-09-17 19:03:27 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 23:06:40 +07:00
2026-09-20 15:00:15 +07:00
2026-09-20 18:02:59 +07:00
2026-09-14 07:12:27 +07:00
2026-09-12 14:47:54 +07:00
2026-09-18 07:31:25 +07:00
2026-09-20 15:36:13 +07:00
2026-09-20 19:46:57 +07:00
2026-09-20 11:06:14 +07:00
2026-09-12 16:22:58 +07:00
2026-09-17 19:03:27 +07:00
2026-09-20 18:11:32 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 14:47:54 +07:00
2026-09-17 19:50:29 +07:00
2026-09-13 17:55:00 +07:00
2026-09-20 18:32:01 +07:00
2026-09-13 13:07:25 +07:00
2026-09-13 15:27:31 +07:00
2026-09-14 08:11:35 +07:00
2026-09-20 15:14:56 +07:00
2026-09-13 19:43:18 +07:00
2026-09-18 13:47:42 +07:00
2026-09-18 13:47:42 +07:00
2026-09-13 10:35:20 +07:00
2026-09-19 05:55:48 +07:00
2026-09-19 06:33:28 +07:00
2026-09-20 13:54:07 +07:00
2026-09-20 15:36:27 +07:00
2026-09-19 06:40:53 +07:00
2026-09-19 06:12:41 +07:00
2026-09-19 05:52:47 +07:00
2026-09-20 10:36:05 +07:00
2026-09-19 19:44:56 +07:00
2026-09-19 22:53:16 +07:00
2026-09-20 18:46:48 +07:00
2026-09-19 06:06:44 +07:00
2026-09-20 10:51:22 +07:00
2026-09-19 06:59:22 +07:00
2026-09-19 19:44:56 +07:00
2026-09-18 22:50:54 +07:00
2026-09-20 19:30:04 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 09:11:34 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 23:18:28 +07:00
2026-09-17 22:04:48 +07:00
2026-09-20 18:33:05 +07:00
2026-09-12 22:44:33 +07:00
2026-09-12 22:44:33 +07:00
2026-09-12 22:44:33 +07:00
2026-09-12 22:44:33 +07:00
2026-09-19 05:21:02 +07:00
2026-09-19 05:21:02 +07:00
2026-09-14 07:12:27 +07:00
2026-09-12 11:15:58 +07:00
2026-09-13 15:23:37 +07:00
2026-09-13 14:49:11 +07:00
2026-09-18 12:16:05 +07:00
2026-09-20 20:21:41 +07:00
2026-09-19 04:24:52 +07:00
2026-09-19 21:13:03 +07:00
2026-09-19 05:21:02 +07:00
2026-09-19 21:59:11 +07:00
2026-09-20 19:09:26 +07:00
2026-09-13 09:32:58 +07:00
2026-09-19 06:41:57 +07:00
2026-09-19 19:44:56 +07:00
2026-09-20 18:02:59 +07:00
2026-09-12 22:00:13 +07:00
2026-09-12 23:06:40 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 18:18:24 +07:00
2026-09-20 18:18:24 +07:00
2026-09-12 23:18:28 +07:00
2026-09-20 18:23:22 +07:00
2026-09-12 23:18:28 +07:00
2026-09-19 05:21:02 +07:00
2026-09-19 05:21:02 +07:00
2026-09-12 16:09:27 +07:00
2026-09-12 16:34:25 +07:00
2026-09-12 23:06:40 +07:00
2026-09-20 13:07:09 +07:00
2026-09-12 23:06:40 +07:00
2026-09-20 07:20:27 +07:00
2026-09-12 04:46:41 +07:00
2026-09-12 16:46:30 +07:00
2026-09-12 16:46:30 +07:00
2026-09-18 22:50:54 +07:00
2026-09-12 16:46:30 +07:00
2026-09-11 20:11:01 +07:00
2026-09-13 15:40:08 +07:00
2026-09-13 17:54:36 +07:00
2026-09-13 15:40:08 +07:00
2026-09-13 15:40:08 +07:00
2026-09-20 18:18:24 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 10:40:47 +07:00
2026-09-12 05:32:25 +07:00
2026-09-11 20:11:01 +07:00
2026-09-11 20:11:01 +07:00
2026-09-12 05:32:25 +07:00
2026-09-20 18:02:59 +07:00
2026-09-20 18:18:24 +07:00
2026-09-12 23:18:28 +07:00
2026-09-12 23:06:40 +07:00
2026-09-14 08:37:30 +07:00
2026-09-13 07:50:03 +07:00
2026-09-12 23:06:40 +07:00
2026-09-13 23:22:37 +07:00
2026-09-13 07:50:03 +07:00
2026-09-12 16:09:48 +07:00
2026-09-13 14:49:11 +07:00
2026-09-13 09:32:58 +07:00
2026-09-18 11:56:22 +07:00
2026-09-14 07:12:27 +07:00
2026-09-14 07:12:27 +07:00
2026-09-19 05:21:02 +07:00
2026-09-17 18:42:01 +07:00
2026-09-17 18:42:01 +07:00
2026-09-12 05:32:25 +07:00
2026-09-12 10:51:14 +07:00
2026-09-14 10:16:42 +07:00
2026-09-17 18:42:01 +07:00
2026-09-17 21:49:40 +07:00
2026-09-12 14:47:54 +07:00
2026-09-20 18:18:20 +07:00
2026-09-20 18:18:20 +07:00
2026-09-13 18:00:35 +07:00
2026-09-13 18:00:35 +07:00
2026-09-12 05:32:25 +07:00
2026-09-20 19:56:17 +07:00
2026-09-12 10:40:47 +07:00
2026-09-17 22:17:19 +07:00
2026-09-12 05:32:25 +07:00
2026-09-13 17:40:59 +07:00
2026-09-19 05:21:02 +07:00
2026-09-12 11:38:24 +07:00
2026-09-12 11:38:24 +07:00
2026-09-20 07:20:27 +07:00
2026-09-12 11:07:57 +07:00
2026-09-19 21:18:57 +07:00
2026-09-12 23:06:40 +07:00
2026-09-19 05:21:02 +07:00
2026-09-20 18:12:45 +07:00
2026-09-13 14:49:11 +07:00
2026-09-20 11:53:37 +07:00
2026-09-17 22:55:30 +07:00
2026-09-17 19:54:32 +07:00
2026-09-12 23:18:28 +07:00
2026-09-12 11:15:58 +07:00
2026-09-19 05:21:02 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 11:07:57 +07:00
2026-09-17 18:42:01 +07:00
2026-09-18 12:16:05 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 11:12:49 +07:00
2026-09-12 11:07:57 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 14:47:54 +07:00
2026-09-12 11:41:24 +07:00
2026-09-20 19:30:04 +07:00