nickg / nvc

VHDL compiler and simulator
https://www.nickg.me.uk/nvc/
GNU General Public License v3.0
629 stars 77 forks source link

parenthesis mess-up asserts #956

Closed scolabirra closed 4 weeks ago

scolabirra commented 1 month ago

I updated to a more recent version and I'm getting errors on asserts that weren't there before: here an example of asserts rising issues:

library ieee;
use ieee.numeric_std.all;

entity test_mod is

  generic (
    size : integer
  );

end entity test_mod;

architecture test of test_mod is

begin
  assert size mod 4 = 0     report "test a"; -- good
  assert (size mod 4) = 0   report "test a"; -- error
  assert (size+1) mod 4 = 0 report "test a"; -- error
  assert (size mod 4 = 0)   report "test a"; -- error
end test;

The given error is


** Error: no matching operator "mod" [INTEGER, universal_integer return BOOLEAN | BIT]
    > test.vhd:16
    |
 16 |   assert (size mod 4) = 0 report "a is not 0";
    |           ^^^^^^^^^^
    |
    = Note: no implicit conversion was performed on the second argument as the innermost complete context did not
            determine a unique numeric type
    = Help: IEEE Std 1076-2008 section 9.3.6 "Type conversions"
nickg commented 1 month ago

Probably a regression caused by the fix to #952, sorry about that.