vhdlpp: ExpInteger::probe_type() returns either INTEGER or NATURAL, depending on the value.

This commit is contained in:
Maciej Suminski 2016-01-28 15:50:50 +01:00
parent 6b1e08cdb0
commit 25671048f6
1 changed files with 4 additions and 1 deletions

View File

@ -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)