Issue 148675
Summary [flang] Unexpected compile time failure when resolving a reference to a defined assignment `ASSIGNMENT(=)`
Labels flang:frontend
Assignees
Reporter DanielCChen
    Consider the following code:
```
module m
  type dt
    integer i
  contains
 generic :: ASSIGNMENT(=) => assign
    procedure, pass :: assign => myassign
    generic :: ASSIGNMENT(=) => otherassign               !! If commented out, it compiles successfully
    procedure, pass :: otherassign => myassign            !! If commented out, it compiles successfully
  end type
contains
  subroutine myassign(x,y)
    class(dt), intent(out) :: x
 integer, intent(in) :: y
    x%i = y + 1
  end subroutine

 subroutine sub
    type(dt) xdt
    xdt = 5
  end subroutine
end module
```

Flang complains:
```
error: Semantic errors in assign08.f
./assign08.f:19:5: error: No intrinsic or user-defined ASSIGNMENT(=) matches operand types TYPE(dt) and INTEGER(4)
      xdt = 5
 ^^^^^^^
```


_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to