From a4af3021f0cedd633e612021bf1483c6eebc9251 Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Sun, 6 Sep 2026 14:05:35 -0700 Subject: [PATCH] tighten bounds of the type of a numeric literal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is believed to have no effect for now. Its primary utility is for speculative future work where we may change how the `coerces_to` logic works. Github: closes #337 “tightly bound 'Number'’s type” --- librumur/src/Number.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/librumur/src/Number.cc b/librumur/src/Number.cc index 855b6922..38918571 100644 --- a/librumur/src/Number.cc +++ b/librumur/src/Number.cc @@ -35,7 +35,8 @@ void Number::visit(ConstBaseTraversal &visitor) const { bool Number::constant() const { return true; } Ptr Number::type() const { - return Ptr::make(nullptr, nullptr, location()); + const Ptr bound = Ptr::make(value, location()); + return Ptr::make(bound, bound, location()); } mpz_class Number::constant_fold() const { return value; }