From e31f8827aa700dd69333dd5fc6804a90b5d94742 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 12 Oct 2019 19:16:33 +0200 Subject: synth-expr: handle integer type conversion. --- src/synth/synth-expr.adb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/synth/synth-expr.adb b/src/synth/synth-expr.adb index f8f9e0911..500d587d7 100644 --- a/src/synth/synth-expr.adb +++ b/src/synth/synth-expr.adb @@ -1367,7 +1367,10 @@ package body Synth.Expr is Val := Synth_Expression_With_Basetype (Syn_Inst, Expr); case Get_Kind (Conv_Type) is when Iir_Kind_Integer_Subtype_Definition => - if Val.Typ.Kind = Type_Float then + if Val.Typ.Kind = Type_Discrete then + -- Int to int. + return Val; + elsif Val.Typ.Kind = Type_Float then return Create_Value_Discrete (Int64 (Val.Fp), Conv_Typ); else Error_Msg_Synth (+Conv, "unhandled type conversion (to int)"); -- cgit v1.2.3