From 25671048f6c0ade9cb0dada86e021853baa17061 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 28 Jan 2016 15:50:50 +0100 Subject: [PATCH] vhdlpp: ExpInteger::probe_type() returns either INTEGER or NATURAL, depending on the value. --- vhdlpp/expression_elaborate.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vhdlpp/expression_elaborate.cc b/vhdlpp/expression_elaborate.cc index 82fd1e6d8..6454f8f85 100644 --- a/vhdlpp/expression_elaborate.cc +++ b/vhdlpp/expression_elaborate.cc @@ -843,7 +843,10 @@ const VType* ExpFunc::fit_type(Entity*ent, ScopeBase*scope, const VTypeArray*) c const VType* ExpInteger::probe_type(Entity*, ScopeBase*) const { - return &primitive_INTEGER; + if(value_ >= 0) + return &primitive_NATURAL; + else + return &primitive_INTEGER; } int ExpInteger::elaborate_expr(Entity*ent, ScopeBase*scope, const VType*ltype)