lfortran icon indicating copy to clipboard operation
lfortran copied to clipboard

comparison operator not implemented

Open opixdown opened this issue 5 months ago • 1 comments

MRE

program minloc_mre
  implicit none

  integer, parameter :: grid(2, 2) = reshape([1, 2, 2, 1], [2, 2])
  integer, parameter :: where_is_two(2) = minloc(grid, dim=1, mask=grid > 1, back=.true.)

  print *, "minloc:", where_is_two

  if (any(where_is_two /= [2, 1])) error stop
end program minloc_mre

output

(base) opixdown@Atharvs-MacBook-Air lfortran % lfortran t.f90

semantic error: Comparison operator not implemented
 --> t.f90:7:11
  |
7 |   if (any(where_is_two /= [2, 1])) error stop
  |           ^^^^^^^^^^^^^^^^^^^^^^

gfortran behavior

(base) opixdown@Atharvs-MacBook-Air lfortran % gfortran t.f90 && ./a.out

 minloc:           2           1

opixdown avatar Jun 26 '26 08:06 opixdown

Hi @opixdown thanks for the bug. I am on this .

Jatinagarwal24 avatar Jun 26 '26 08:06 Jatinagarwal24