From 02b2dbf421dd9dd47c247baf13a4073b4fff1ab6 Mon Sep 17 00:00:00 2001 From: Romain Beguet Date: Mon, 12 Sep 2022 16:37:55 +0200 Subject: [PATCH] V908-033: Simplify expr_type for NumberDecls. --- ada/ast.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/ada/ast.py b/ada/ast.py index 74016bc24..2d20ebe5f 100644 --- a/ada/ast.py +++ b/ada/ast.py @@ -10155,15 +10155,7 @@ class NumberDecl(BasicDecl): @langkit_property(call_memoizable=True) def expr_type(): - p = Var(If(Self.expr.type_val.is_null, - Entity.expr.resolve_names, - True)) - - typ = Var(If(p, - Self.expr.type_val.cast_or_raise(BaseTypeDecl.entity), - No(BaseTypeDecl.entity))) - - return If(typ.is_int_type, + return If(Entity.expr.expression_type.is_int_type, Self.universal_int_type, Self.universal_real_type).cast(BaseTypeDecl.entity)